26 #ifndef MACRO_TOOLS_HPP
27 #define MACRO_TOOLS_HPP
29 #include "../my_config.h"
55 #define BUFFER_SIZE 102400
57 #if SSIZE_MAX < BUFFER_SIZE
59 #define BUFFER_SIZE SSIZE_MAX
69 constexpr U_I GLOBAL_ELASTIC_BUFFER_SIZE = 51200;
71 extern const archive_version macro_tools_supported_version;
72 extern const std::string LIBDAR_STACK_LABEL_UNCOMPRESSED;
73 extern const std::string LIBDAR_STACK_LABEL_CLEAR;
74 extern const std::string LIBDAR_STACK_LABEL_UNCYPHERED;
75 extern const std::string LIBDAR_STACK_LABEL_LEVEL1;
81 const label & internal_name,
82 const label & data_name,
83 bool slice_header_format_07,
84 const std::string & execute);
111 const std::shared_ptr<entrepot> & where,
112 const std::string &basename,
113 const infinint & min_digits,
114 const std::string &extension,
116 const secu_string &pass,
120 const std::string &input_pipe,
121 const std::string &output_pipe,
122 const std::string & execute,
123 infinint & second_terminateur_offset,
125 bool has_external_cat,
126 bool sequential_read,
128 std::list<signator> & gnupg_signed,
130 U_I multi_threaded_crypto,
131 U_I multi_threaded_compress,
140 const header_version & ver,
143 const infinint & second_terminateur_offset,
144 std::list<signator> & signatories,
150 const header_version & ver,
153 const infinint & second_terminateur_offset,
154 std::list<signator> & signatories,
159 const header_version & ver,
160 const pile_descriptor & cata_pdesc,
161 const infinint & cat_size,
162 std::list<signator> & signatories,
164 const label & lax_layer1_data_name,
167 extern catalogue *macro_tools_lax_search_catalogue(
const std::shared_ptr<user_interaction> & dialog,
169 const archive_version & edition,
172 bool even_partial_catalogues,
173 const label & layer1_data_name);
176 extern infinint macro_tools_get_terminator_start(generic_file & f,
const archive_version & reading_ver);
240 header_version & ver,
241 slice_layout & slicing,
242 const slice_layout *ref_slicing,
243 const std::shared_ptr<entrepot> & sauv_path_t,
244 const std::string & filename,
245 const std::string & extension,
249 const infinint & pause,
251 U_I compression_level,
252 U_I compression_block_size,
253 const infinint & file_size,
254 const infinint & first_file_size,
255 const std::string & execute,
257 const secu_string & pass,
259 const std::vector<std::string> & gnupg_recipients,
260 const std::vector<std::string> & gnupg_signatories,
262 const std::string & slice_permission,
263 bool add_marks_for_sequential_reading,
264 const std::string & user_comment,
266 const infinint & slice_min_digits,
267 const label & internal_name,
268 const label & data_name,
269 const infinint & iteration_count,
271 U_I multi_threaded_crypto,
272 U_I multi_threaded_compress);
288 const header_version & ver,
289 const catalogue & cat,
293 const std::vector<std::string> & gnupg_recipients,
294 const std::vector<std::string> & gnupg_signatories,
315 const std::string &input,
316 const std::string & output,
328 U_I compression_level,
340 U_I compression_level,
defines the entrepot interface.
void macro_tools_close_layers(const std::shared_ptr< user_interaction > &dialog, pile &layers, const header_version &ver, const catalogue &cat, bool info_details, crypto_algo crypto, compression algo, const std::vector< std::string > &gnupg_recipients, const std::vector< std::string > &gnupg_signatories, bool empty)
dumps the catalogue and close all the archive layers to terminate the archive
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
proto_compressor * macro_tools_build_streaming_compressor(compression algo, generic_file &base, U_I compression_level, U_I num_workers)
return a proto_compressor object realizing the desired (de)compression level/aglo on top of "base" in...
class pile definition. Used to manage a stack of generic_file objects
the trivial_sar classes manages the slicing layer when single slice is used
void macro_tools_open_archive(const std::shared_ptr< user_interaction > &dialog, const std::shared_ptr< entrepot > &where, const std::string &basename, const infinint &min_digits, const std::string &extension, crypto_algo crypto, const secu_string &pass, U_32 crypto_size, pile &stack, header_version &ver, const std::string &input_pipe, const std::string &output_pipe, const std::string &execute, infinint &second_terminateur_offset, bool lax, bool has_external_cat, bool sequential_read, bool info_details, std::list< signator > &gnupg_signed, slice_layout &sl, U_I multi_threaded_crypto, U_I multi_threaded_compress, bool header_only)
setup the given pile object to contain a stack of generic_files suitable to read an archive ...
the crypto algoritm definition
gf_mode
generic_file openning modes
object describing the slicing of an archive
catalogue * macro_tools_get_derivated_catalogue_from(const std::shared_ptr< user_interaction > &dialog, pile &data_stack, pile &cata_stack, const header_version &ver, bool info_details, infinint &cat_size, const infinint &second_terminateur_offset, std::list< signator > &signatories, bool lax_mode)
uses terminator to skip to the position where to find the catalogue and read it, taking care of havin...
catalogue * macro_tools_get_catalogue_from(const std::shared_ptr< user_interaction > &dialog, pile &stack, const header_version &ver, bool info_details, infinint &cat_size, const infinint &second_terminateur_offset, std::list< signator > &signatories, bool lax_mode)
uses terminator to skip to the position where to find the catalogue and read it
void macro_tools_open_pipes(const std::shared_ptr< user_interaction > &dialog, const std::string &input, const std::string &output, tuyau *&in, tuyau *&out)
open a pair of tuyau objects encapsulating two named pipes.
crypto_algo
the different cypher available for encryption (strong or weak)
catalogue * macro_tools_read_catalogue(const std::shared_ptr< user_interaction > &dialog, const header_version &ver, const pile_descriptor &cata_pdesc, const infinint &cat_size, std::list< signator > &signatories, bool lax_mode, const label &lax_layer1_data_name, bool only_detruits)
read the catalogue from cata_stack assuming the cata_stack is positionned at the beginning of the are...
compression parameters for API
abstracted ancestor class for compressor and parallel_compressor classes
defines the implementation of pipe under the generic_file interface.mainly used between zapette and s...
switch module to limitint (32 ou 64 bits integers) or infinint
trivial_sar * macro_tools_open_archive_tuyau(const std::shared_ptr< user_interaction > &dialog, S_I fd, gf_mode mode, const label &internal_name, const label &data_name, bool slice_header_format_07, const std::string &execute)
create an container to write an archive to a pipe
compression
the different compression algorithm available
void macro_tools_create_layers(const std::shared_ptr< user_interaction > &dialog, pile &layers, header_version &ver, slice_layout &slicing, const slice_layout *ref_slicing, const std::shared_ptr< entrepot > &sauv_path_t, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, compression algo, U_I compression_level, U_I compression_block_size, const infinint &file_size, const infinint &first_file_size, const std::string &execute, crypto_algo crypto, const secu_string &pass, U_32 crypto_size, const std::vector< std::string > &gnupg_recipients, const std::vector< std::string > &gnupg_signatories, bool empty, const std::string &slice_permission, bool add_marks_for_sequential_reading, const std::string &user_comment, hash_algo hash, const infinint &slice_min_digits, const label &internal_name, const label &data_name, const infinint &iteration_count, hash_algo kdf_hash, U_I multi_threaded_crypto, U_I multi_threaded_compress)
build layers for a new archive
hash_algo
hashing algorithm available
range macro_tools_get_slices(const cat_nomme *obj, slice_layout sl)
gives the location of data EA and FSA (when they are saved) of the object given in argument ...
class than provide a way to manipulate and represent range of integer numbers (infinint) ...
proto_compressor * macro_tools_build_block_compressor(compression algo, generic_file &base, U_I compression_level, U_I num_workers, U_I block_size)
return a proto_compressor object realizing the desired (de)compression level/algo on to of "base" in ...
libdar namespace encapsulate all libdar symbols
here is defined the classe used to manage catalogue of archives