| Disk ARchive 2.6.11 Full featured and portable backup and archiving tool

Files | Classes | Macros | Typedefs | Enumerations | Functions | Variables
Private

Libdar internal symbols. More...

## Files
file | cache.hpp
| contains the cache class
file | cache_global.hpp
| adaptation of the cache class to the fichier_global interface
file | candidates.hpp
| helper class for class data_tree to find the list of archive to restore for a given file
file | capabilities.hpp
| provide information about current thread (underlying using the widthdrawn POSIX.1e API)
file | cat_all_entrees.hpp
| include file gathering all entree found in a catalogue
file | cat_blockdev.hpp
| class used to record block special devices in a catalogue
file | cat_chardev.hpp
| class used to record character special devices in a catalogue
file | cat_delta_signature.hpp
| class used to manage binary delta signature in catalogue and archive
file | cat_detruit.hpp
| used to record information in a catalogue about a deleted file (differential backup context)
file | cat_device.hpp
| parent class for all special devices inodes
file | cat_directory.hpp
| class used to organize objects in tree in catalogue as like directories in a filesystem
file | cat_door.hpp
| class used in a catalogue to store solaris door filesystem entries
file | cat_entree.hpp
| base class for all object contained in a catalogue
file | cat_eod.hpp
| object exchanged with a catalogue (never stored in it) to signal the end of a directory
file | cat_etoile.hpp
| class holding an cat_inode object that get pointed by multiple mirage objects (smart pointers) to record hard links in a catalogue
file | cat_file.hpp
| class used to record plain files in a catalogue
file | cat_ignored.hpp
| class used to remember that an entry has been ignored and shall not be recorded as deleted using a detruit object in a catalogue
file | cat_ignored_dir.hpp
| class used to remember in a catalogue that a cat_directory has been ignored
file | cat_inode.hpp
| base object for all inode types, managed EA and FSA, dates, permissions, ownership, ...
file | cat_lien.hpp
| class used to store symbolic links in a catalogue
file | cat_mirage.hpp
| smart pointer to an etoile object. Used to store hard link information inside a catalogue
file | cat_nomme.hpp
| base class of all objects contained in a catalogue and that can be named
file | cat_prise.hpp
| class to record filesystem (UNIX) sockets in a catalogue
file | cat_signature.hpp
| class used to write and read from archive the type and status of each entry in a catalogue
file | cat_status.hpp
| the different status of data and EA
file | cat_tube.hpp
| class to record named pipes in a catalogue
file | catalogue.hpp
| here is defined the classe used to manage catalogue of archives
file | compressor.hpp
| compression engine implementation
file | contextual.hpp
| class contextual adds the information of phases in the generic_file
file | crc.hpp
| class crc definition, used to handle Cyclic Redundancy Checks
file | crypto_asym.hpp
| the asymetric cryptographical algoritms relying on gpgme
file | crypto_sym.hpp
| class crypto_sym for symetrical cipherings
file | cygwin_adapt.h
| thin C adaptation layer to Cygwin specifities
file | cygwin_adapt.hpp
| thin C++ adaptation layer to Cygwin specifities
file | data_dir.hpp
| classes used to store directory tree information in dar_manager databases
file | data_tree.hpp
| base classes used to store entree information in dar_manager databases
file | database_header.hpp
| defines the database structure in file
file | defile.hpp
| here is defined the defile class
file | ea.hpp
| contains a set of routines to manage EA values associated to a file
file | ea_filesystem.hpp
| filesystem dependent Extended Attributes operations
file | elastic.hpp
| here is defined the elastic class
file | entrepot_local.hpp
| defines the implementation for local filesystem entrepot The entrepot_local is the only implementation of an entrepot class present in libdar. It correspond to local filesystems. The reason of existence of the entrepot stuff is to allow external application like webdar to drop/read slices over the network using FTP protocol for example. External applications only have to define Their own implementation of the entrepot interface and file-like objects they generates (inherited from class fichier_global), libdar uses them throught the generic interface. This avoids having network related stuff inside libdar, which for security reason and functions/roles separation would not be a good idea
file | erreurs_ext.hpp
| contains some additional exception class thrown by libdar
file | escape.hpp
| class escape definition, used for sequential reading of archives
file | escape_catalogue.hpp
| class escape_catalogue definition. Used for sequential writing to archives, as well as several other inherited classes from catalogue.hpp
file | etage.hpp
| definition of the etage structure is done here
file | fichier_global.hpp
| class fichier_global definition. This class is a pure virtual class class fichier_global is an abstraction of files objects whatever is their localisation like local filesystem, remote ftp server, etc. inherited classes (like fichier_local) provide full implementation
file | fichier_libcurl.hpp
| class fichier_libcurl definition. This is a full implementation/inherited class of class fichier_global this type of object are generated by entrepot_libcurl.
file | fichier_local.hpp
| class fichier_local definition. This is a full implementation/inherited class of class fichier_global this type of object are generated by entrepot_local.
file | filesystem_backup.hpp
| filesystem_backup class realizes the interface with the filesystem for backing up
file | filesystem_diff.hpp
| class filesystem_diff makes a flow of inode to feed the difference filter routine
file | filesystem_hard_link_read.hpp
| filesystem_hard_link_read classes manages hardlinked inode read from filesystem
file | filesystem_hard_link_write.hpp
| class filesystem_hard_link_write keeps trace of already written inode to restore hard links
file | filesystem_restore.hpp
| class filesystem_restores create inodes from a flow of libdar objects
file | filesystem_specific_attribute.hpp
| filesystem specific attributes
file | filesystem_tools.hpp
| a set of tools used by filesystem_* classes
file | filtre.hpp
| here is all the core routines for the operations
file | generic_file.hpp
| class generic_file is defined here as well as class fichier
file | generic_file_overlay_for_gpgme.hpp
| adaptation class from gpgme data buffer to libdar generic_file interface
file | generic_rsync.hpp
| class generic_rsync provides a generic_file interface to librsync
file | generic_thread.hpp
| class generic_thread provides a way to interact with a generic_file ran in an other thread
file | generic_to_global_file.hpp
| this class provides an fichier_global interface for any type of generic_file object
file | gf_mode.hpp
| generic modes to open file
file | hash_fichier.hpp
| class hash_fichier definition.
file | header.hpp
| slice header structure is defined here
file | header_version.hpp
| archive global header/trailer structure is defined here
file | i_archive.hpp
| the archive class implementation is defined in this module
file | i_database.hpp
| this file holds the definition of class database implementation (pimpl idiom)
file | i_entrepot_libcurl.hpp
| defines the implementation for remote filesystem entrepot using libcurl
file | i_libdar_xform.hpp
| API for dar_xform functionnality.
file | int_tools.hpp
| elementary operation for infinint integers
file | label.hpp
| define the datastructure "label" used to identify slice membership to an archive
file | macro_tools.hpp
| macroscopic tools for libdar internals
file | mem_ui.hpp
| class mem_ui definition. This class is to be used as parent class to handle user_interaction object management
file | memory_file.hpp
| Memory_file is a generic_file class that only uses virtual memory.
file | messaging.hpp
| messaging_decode and messaging_encode are used to insert messages in a flow of data blocks
file | mycurl_easyhandle_node.hpp
| used to optimize session creation done by libcurl
file | mycurl_easyhandle_sharing.hpp
| used to optimize network session establised by libcurl
file | mycurl_shared_handle.hpp
| structure used to optimize network session creation done by libcurl
file | nls_swap.hpp
| provides a set of macro to change the NLS from user application domaine to libdar domain and viceversa
file | null_file.hpp
| /dev/null type file implementation under the generic_file interface
file | op_tools.hpp
| contains tools helper for overwriting policy management
file | pile.hpp
| class pile definition. Used to manage a stack of generic_file objects
file | pile_descriptor.hpp
| optimization structure to quickly access some commonly used layers of a stack of generic_file
file | proto_generic_file.hpp
| precursor class of generic_file used to avoid cyclic dependencies with storage and infinint
file | sar.hpp
| the sar and trivial_sar classes, they manage the slicing layer
file | sar_tools.hpp
| a set of tools aims to help Segmentation And Reassemblement (sar) class
file | scrambler.hpp
| contains the definition of the scrambler class, a very weak encryption scheme
file | secu_memory_file.hpp
| secu_memory_file is a generic_file class that only uses secured memory (not swappable and zeroed after use)
file | semaphore.hpp
| definition of class semaphore, used to manage invocation of backup hook for files
file | slave_thread.hpp
| class slave_thread is runs a I/O operations on a given generic_file in a separated thread
file | slave_zapette.hpp
| remote control for dar_slave.
file | slice_layout.hpp
| object describing the slicing of an archive
file | smart_pointer.hpp
| template class implementing memory efficient smart pointer
file | sparse_file.hpp
| class sparse_file definition, used to handle holes in files
file | storage.hpp
| contains a class that permits arbitrary large data storage
file | terminateur.hpp
| the terminateur class which defines the position of the catalogue
file | thread_cancellation.hpp
| to be able to cancel libdar operation while running in a given thread.
file | tlv.hpp
| Generic Type Length Value data structures.
file | tlv_list.hpp
| List of Generic Type Length Value data structures.
file | tools.hpp
| a set of general purpose routines
file | trivial_sar.hpp
| the trivial_sar classes manages the slicing layer when single slice is used
file | tronc.hpp
| defines a limited segment over another generic_file.
file | tronconneuse.hpp
| defines a block structured file.
file | trontextual.hpp
| class trontextual is a contextual variant of class tronc
file | tuyau.hpp
| defines the implementation of pipe under the generic_file interface.
file | user_group_bases.hpp
| defines class that speed up the uid to username and gid to group name lookup
file | wrapperlib.hpp
| libz and libbz2 wrapper to have identical interface to these libraries.
file | zapette.hpp
| remote control between dar and dar_slave.
file | zapette_protocol.hpp
| protocol management between archive and libdar_slave classes
file | my_config.h
| include macro defined by the configure script and some specific additional ones

## Classes
class | libdar::cache
| the cache class implements a fixed length read/write caching mechanism More...
class | libdar::cache_global
| the cache_global cache is an adaptation of the cache class to the fichier_global interface More...
class | libdar::candidates
| helper class for data_tree More...
class | libdar::cat_blockdev
| the block device class More...
class | libdar::cat_chardev
| the char device class More...
class | libdar::cat_delta_signature
| the cat_delta_signature file class More...
class | libdar::cat_detruit
| the deleted file entry More...
class | libdar::cat_device
| the special cat_device root class More...
class | libdar::cat_directory
| the cat_directory inode class More...
class | libdar::cat_door
| the class for Door IPC (mainly for Solaris) More...
class | libdar::cat_entree
| the root class from all other inherite for any entry in the catalogue More...
class | libdar::cat_eod
| the End of Directory entry class More...
class | libdar::cat_etoile
| the hard link implementation More...
class | libdar::cat_file
| the plain file class More...
class | libdar::cat_ignored
| the present file to ignore (not to be recorded as deleted later) More...
class | libdar::cat_ignored_dir
| the ignored cat_directory class, to be promoted later as empty cat_directory if needed More...
class | libdar::cat_inode
| the root class for all cat_inode More...
class | libdar::cat_lien
| the symbolic link inode class More...
class | libdar::cat_mirage
| the hard link implementation, cat_mirage is the named entry owned by a directory it points to a common "cat_etoile class" More...
class | libdar::cat_nomme
| the base class for all entry that have a name More...
class | libdar::cat_prise
| the Unix socket inode class More...
class | libdar::cat_signature
| class cat_signature combines the cat_entree::signature() of the object with its saved_status and read and store this combinason More...
class | libdar::cat_tube
| the named pipe class More...
class | libdar::catalogue
| the catalogue class which gather all objects contained in a give archive More...
class | libdar::compressor
| compression class for gzip and bzip2 algorithms More...
class | libdar::contextual
| the contextual class adds the information of phases in the generic_file More...
class | libdar::crc
| pure virtual class defining interface of a CRC object More...
class | libdar::crc_i
| crc implementation based on infinint More...
class | libdar::crc_n
| crc implementation based on U_I More...
class | libdar::crypto_asym
| asymetric ciphering More...
class | libdar::crypto_sym
| symetrical strong encryption, interface to grypt library More...
class | libdar::data_dir
| the data_dir class inherits from data_tree and holds the directory tree's parent relationship More...
class | libdar::data_tree
| the data_tree class stores presence of a given file in a set of archives More...
class | libdar::defile
| the defile class keep trace of the real path of files while the flow in the filter routines More...
class | libdar::ea_attributs
| the class ea_attributs manages the set of EA that can be associated to an inode More...
class | libdar::elastic
| the elastic buffer class More...
class | libdar::entrepot_local
class | libdar::Ethread_cancel_with_attr
| Ethread_cancel with infinint attribute. More...
struct | libdar::etage
| the etage structure keep trace of directory contents More...
class | libdar::fichier_global
| abstraction of filesystem files for entrepot More...
class | libdar::fichier_local
| filesystem local files More...
class | libdar::filesystem_backup
| makes a flow sequence of inode to feed the backup filtering routing More...
class | libdar::filesystem_diff
| make a flow of inode to feed the difference filter routine More...
class | libdar::filesystem_hard_link_read
| keep trace of hard links when reading the filesystem More...
class | libdar::filesystem_hard_link_write
| keep trace of already written inodes to restore hard links More...
class | libdar::filesystem_restore
| receive the flow of inode from the restoration filtering routing and promotes these to real filesystem objects More...
class | libdar::filesystem_specific_attribute
| Filesystem Specific Attributes (FSA) class. More...
class | libdar::filesystem_specific_attribute_list
| interface to fileystem for FSA More...
class | libdar::fsa_infinint
| fsa based on integer More...
class | libdar::fsa_time
| fsa based on time More...
class | libdar::generic_file
| this is the interface class from which all other data transfer classes inherit More...
class | libdar::generic_file_overlay_for_gpgme
| generic_file interface for for gpgme More...
class | libdar::generic_rsync
| generic_file interface to librsync More...
class | libdar::generic_thread
| let a generic_file be managed by another thread More...
class | libdar::generic_to_global_file
| provides a fichier_global interface for any type of generic_file More...
class | libdar::hash_fichier
| manages the generation of a hash More...
class | libdar::header
| this class manages the header of each slice More...
class | libdar::header_version
| manages the archive header and trailer More...
class | libdar::database::i_database
| the class i_database is the implementation of class database More...
class | libdar::libdar_xform::i_libdar_xform
| class implementing the dar_xform feature More...
class | libdar::label
| manage label data structure used in archive slice headers More...
class | libdar::limitint< B >
class | libdar::mem_ui
| class mem_ui to keep a copy of a user_interaction object More...
class | libdar::memory_file
| generic_file stored in memory More...
class | libdar::messaging_decode
| decoding received messages More...
class | libdar::messaging_encode
| encoding messages to be sent More...
class | libdar::null_file
| the null_file class implements the /dev/null behavior More...
class | libdar::pile
| stores a stack of generic_files writing/reading on each others More...
class | libdar::proto_generic_file
| ancestor class of generic_file More...
class | libdar::sar
| Sar class stands for Segmentation And Reassembly class. More...
class | libdar::scrambler
| scrambler is a very weak encryption scheme More...
class | libdar::semaphore
| class semaphore More...
class | libdar::slave_zapette
| this class answers to order given by a zapette object More...
class | libdar::smart_node< T >
| class which holds the address of the allocated memory for many smart_pointers More...
class | libdar::smart_pointer< T >
| smart pointer class to be used to automagically manage multiple time pointed to address More...
class | libdar::statistics
| class used by libdar::archive class to give a summary of treated file during and after an operation More...
class | libdar::storage
| arbitrary large storage structure More...
class | libdar::terminateur
| terminateur class indicates the location of the beginning of the catalogue More...
class | libdar::thread_cancellation
| class to be used as parent to provide checkpoints to inherited classes More...
class | libdar::tlv
class | libdar::trivial_sar
class | libdar::tronc
| makes a segment of a generic_file appear like a real generic_file More...
class | libdar::tronconneuse
| this is a partial implementation of the generic_file interface to cypher/decypher data block by block. More...
class | libdar::trontextual
| trontextual class is a contextual class tronc, that's all. More...
class | libdar::tuyau
| pipe implementation under the generic_file interface. More...
class | libdar::wrapperlib
| this class encapsulates calls to libz or libbz2 More...
class | libdar::zapette
| zapette emulate a file that is remotely controlled by slave_zapette More...

## Macros
#define | O_TEXT 0
#define | O_BINARY 0

## Typedefs
using | libdar::magic_number = U_32
using | libdar::int_tools_bitfield = unsigned char[8]

## Enumerations
enum | libdar::capa_status { libdar::capa_set, libdar::capa_clear, capa_unknown }
| the EFFECTIVE set the value of the associated capability for the calling thread More...
enum | libdar::saved_status { libdar::saved_status::saved, libdar::saved_status::inode_only, libdar::saved_status::fake, libdar::saved_status::not_saved, libdar::saved_status::delta }
| data saved status for an entry More...
enum | libdar::ea_saved_status { libdar::ea_saved_status::none, libdar::ea_saved_status::partial, libdar::ea_saved_status::fake, libdar::ea_saved_status::full, libdar::ea_saved_status::removed }
| EA saved status for an entry. More...
enum | libdar::fsa_saved_status { libdar::fsa_saved_status::none, libdar::fsa_saved_status::partial, libdar::fsa_saved_status::full }
| FSA saved status for an entry. More...
enum | libdar::elastic_direction { elastic_forward, elastic_backward }
| reading direction of an elastic buffer
enum | libdar::gf_mode { libdar::gf_read_only, libdar::gf_write_only, libdar::gf_read_write }
| generic_file openning modes More...
enum | flag_type { flag_type_terminal = 'T', flag_type_non_terminal = 'N', flag_type_located_at_end_of_slice = 'E' }
enum | libdar::msg_type { unset, order_read_ahead, order_read_ahead_begin, order_read, order_sync_write, answr_sync_write_done, order_skip, order_skip_begin, order_skip_to_eof, order_skip_fwd, order_skip_bkd, answr_skip_done, order_skippable_fwd, order_skippable_fwd_begin, order_skippable_bkd, order_skippable_bkd_begin, answr_skippable, order_get_position, answr_position, answr_position_begin, answr_exception, order_end_of_xmit, order_stop_readahead, answr_readahead_stopped, order_wakeup, data_partial, data_completed }
| the different types of messages
enum | wrapperlib_mode { zlib_mode, bzlib_mode, xz_mode }

## Functions
capa_status | libdar::capability_LINUX_IMMUTABLE (user_interaction &ui, bool verbose)
capa_status | libdar::capability_SYS_RESOURCE (user_interaction &ui, bool verbose)
capa_status | libdar::capability_FOWNER (user_interaction &ui, bool verbose)
capa_status | libdar::capability_CHOWN (user_interaction &ui, bool verbose)
const char * | libdar::cat_entree_signature2string (unsigned char sign)
| convert a signature char to a human readable string
crc * | libdar::create_crc_from_file (proto_generic_file &f, bool old=false)
| generate a CRC object reading it from file
crc * | libdar::create_crc_from_size (infinint width)
| generate a CRC object with adhoc width based on a file size
bool | libdar::crypto_min_ver_libgcrypt_no_bug ()
generic_file * | libdar::database_header_create (const std::shared_ptr< user_interaction > &dialog, const std::string &filename, bool overwrite, compression algozip)
| create the header for a dar_manager database More...
generic_file * | libdar::database_header_open (const std::shared_ptr< user_interaction > &dialog, const std::string &filename, unsigned char &db_version, compression &algozip)
| read the header of a dar_manager database More...
const unsigned char | libdar::database_header_get_supported_version ()
ea_attributs * | libdar::ea_filesystem_read_ea (const std::string &chemin, const mask &filter)
| read EA associated to a given file More...
bool | libdar::ea_filesystem_write_ea (const std::string &chemin, const ea_attributs &val, const mask &filter)
| overwrite some attribute to a given file's attribute list More...
void | libdar::ea_filesystem_clear_ea (const std::string &name, const mask &filter)
| remove all EA of a given file that match a given mask More...
bool | libdar::ea_filesystem_has_ea (const std::string &name)
| test the presence of EA for a given file More...
bool | libdar::ea_filesystem_has_ea (const std::string &name, const mask &filter)
| test the presence of EA for a given file More...
template<class T >
T * | libdar::cloner (const T *x)
bool | libdar::filesystem_tools_has_immutable (const cat_inode &arg)
void | libdar::filesystem_tools_set_immutable (const std::string &target, bool val, user_interaction &ui)
void | libdar::filesystem_tools_supprime (user_interaction &ui, const std::string &ref)
void | libdar::filesystem_tools_widen_perm (user_interaction &dialog, const cat_inode &ref, const std::string &chem, comparison_fields what_to_check)
void | libdar::filesystem_tools_make_owner_perm (user_interaction &dialog, const cat_inode &ref, const std::string &chem, comparison_fields what_to_check, const fsa_scope &scope)
void | libdar::filesystem_tools_make_date (const cat_inode &ref, const std::string &chem, comparison_fields what_to_check, const fsa_scope &scope)
void | libdar::filesystem_tools_attach_ea (const std::string &chemin, cat_inode *ino, const mask &ea_mask)
bool | libdar::filesystem_tools_is_nodump_flag_set (user_interaction &dialog, const path &chem, const std::string &filename, bool info)
path * | libdar::filesystem_tools_get_root_with_symlink (user_interaction &dialog, const path &root, bool info_details)
mode_t | libdar::filesystem_tools_get_file_permission (const std::string &path)
void | libdar::filesystem_tools_make_delta_patch (const std::shared_ptr< user_interaction > &dialog, const cat_file &existing, const std::string &existing_pathname, const cat_file &patcher, const path &directory)
fichier_local * | libdar::filesystem_tools_create_non_existing_file_based_on (const std::shared_ptr< user_interaction > &dialog, std::string filename, path where, std::string &new_filename)
| create in dirname a brand-new filename which name derives from filename More...
void | libdar::filesystem_tools_copy_content_from_to (const std::shared_ptr< user_interaction > &dialog, const std::string &source_path, const std::string &destination_path, const crc *expected_crc)
void | libdar::filtre_restore (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const catalogue &cat, const path &fs_racine, bool fs_warn_overwrite, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics &st, const mask &ea_mask, bool flat, comparison_fields what_to_check, bool warn_remove_no_match, bool empty, bool empty_dir, const crit_action &x_overwrite, archive_options_extract::t_dirty dirty, bool only_deleted, bool not_deleted, const fsa_scope &scope)
void | libdar::filtre_sauvegarde (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const pile_descriptor &pdesc, catalogue &cat, const catalogue &ref, const path &fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, statistics &st, bool make_empty_dir, const mask &ea_mask, const mask &compr_mask, const infinint &min_compr_size, bool nodump, const infinint &hourshift, bool alter_time, bool furtive_read_mode, bool same_fs, comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, bool security_check, const infinint &repeat_count, const infinint &repeat_byte, const infinint &fixed_date, const infinint &sparse_file_min_size, const std::string &backup_hook_file_execute, const mask &backup_hook_file_mask, bool ignore_unknown, const fsa_scope &scope, const std::string &exclude_by_ea, bool delta_signature, const infinint &delta_sig_min_size, const mask &delta_mask, bool delta_diff, bool auto_zeroing_neg_dates, const std::set< std::string > &ignored_symlinks, modified_data_detection mod_data_detect, const delta_sig_block_size &delta_sig_block_len)
void | libdar::filtre_difference (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const catalogue &cat, const path &fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics &st, const mask &ea_mask, bool alter_time, bool furtive_read_mode, comparison_fields what_to_check, const infinint &hourshift, bool compare_symlink_date, const fsa_scope &scope, bool isolated_mode)
void | libdar::filtre_test (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const catalogue &cat, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool empty, statistics &st)
void | libdar::filtre_merge (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const pile_descriptor &pdesc, catalogue &cat, const catalogue *ref1, const catalogue *ref2, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics &st, bool make_empty_dir, const mask &ea_mask, const mask &compr_mask, const infinint &min_compr_size, bool keep_compressed, const crit_action &overwrite, bool warn_overwrite, bool decremental_mode, const infinint &sparse_file_min_size, const fsa_scope &scope, bool delta_signature, bool build_delta_sig, const infinint &delta_sig_min_size, const mask &delta_mask, const delta_sig_block_size &signature_block_size)
void | libdar::filtre_merge_step0 (const std::shared_ptr< user_interaction > &dialog, const catalogue *ref1, const catalogue *ref2, statistics &st, bool decremental_mode, crit_action *&decr, const crit_action *&overwrite, bool &abort, thread_cancellation &thr_cancel)
| initialize variables used for merging in step1 and step2 More...
void | libdar::filtre_merge_step1 (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, catalogue &cat, const catalogue *ref1, const catalogue *ref2, bool info_details, bool display_treated, bool display_skipped, statistics &st, bool make_empty_dir, bool warn_overwrite, bool decremental_mode, crit_action *&decr, const crit_action *&overwrite, bool &abort, thread_cancellation &thr_cancel)
| builds a catalogue from two refs with the given policy and filters
void | libdar::filtre_merge_step2 (const std::shared_ptr< user_interaction > &dialog, const pile_descriptor &pdesc, catalogue &cat, bool info_details, bool display_treated, bool display_treated_only_dir, const mask &compr_mask, const infinint &min_compr_size, bool keep_compressed, const infinint &sparse_file_min_size, bool delta_signature, bool build_delta_sig, const infinint &delta_sig_min_size, const mask &delta_mask, bool &abort, thread_cancellation &thr_cancel, bool repair_mode, const delta_sig_block_size &signature_block_size)
| copies data of "cat" catalogue to the pdesc of a brand new archive More...
void | libdar::filtre_sequentially_read_all_catalogue (catalogue &cat, const std::shared_ptr< user_interaction > &dialog, bool lax_read_mode)
| libdar::generic_thread::generic_thread (generic_file *ptr, U_I data_block_size=tampon_block_size, U_I data_num_block=tampon_num_block, U_I ctrl_block_size=tampon_block_size_ctrl, U_I ctrl_num_block=tampon_num_block_ctrl)
| constructor More...
| libdar::generic_thread::generic_thread (const generic_thread &ref)=delete
| libdar::generic_thread::generic_thread (generic_thread &&ref) noexcept=delete
generic_thread & | libdar::generic_thread::operator= (const generic_thread &ref)=delete
generic_thread & | libdar::generic_thread::operator= (generic_thread &&ref) noexcept=delete
virtual bool | libdar::generic_thread::skippable (skippability direction, const infinint &amount) override
| whether the implementation is able to skip More...
virtual bool | libdar::generic_thread::skip (const infinint &pos) override
| skip at the absolute position More...
virtual bool | libdar::generic_thread::skip_to_eof () override
| skip to the end of file
virtual bool | libdar::generic_thread::skip_relative (S_I x) override
| skip relatively to the current position
virtual infinint | libdar::generic_thread::get_position () const override
| get the current read/write position
virtual void | libdar::generic_thread::inherited_read_ahead (const infinint &amount) override
| tells the object that several calls to read() will follow to probably obtain at least the given amount of data More...
virtual U_I | libdar::generic_thread::inherited_read (char *a, U_I size) override
| implementation of read() operation More...
virtual void | libdar::generic_thread::inherited_write (const char *a, U_I size) override
| implementation of the write() operation More...
virtual void | libdar::generic_thread::inherited_sync_write () override
| generic_file inherited method to sync all pending writes More...
virtual void | libdar::generic_thread::inherited_flush_read () override
| reset internal engine, flush caches in order to read the data at current position More...
virtual void | libdar::generic_thread::inherited_terminate () override
| destructor-like call, except that it is allowed to throw exceptions More...
void | libdar::generic_thread::send_order ()
void | libdar::generic_thread::read_answer ()
void | libdar::generic_thread::check_answer (msg_type expected)
void | libdar::generic_thread::wake_up_slave_if_asked ()
| check whether an order to wakeup the slave has been received, and send wake up the slave
void | libdar::generic_thread::release_block_answer ()
void | libdar::generic_thread::release_data_ptr ()
void | libdar::generic_thread::purge_data_pipe ()
| drops all data in the toslave_data pipe
void | libdar::generic_thread::my_run ()
void | libdar::generic_thread::my_join ()
const char * | libdar::generic_file_get_name (gf_mode mode)
| provides a human readable string defining the gf_mode given in argument
| libdar::header_version::header_version (const header_version &ref)
| libdar::header_version::header_version (header_version &&ref) noexcept
header_version & | libdar::header_version::operator= (const header_version &ref)
header_version & | libdar::header_version::operator= (header_version &&ref) noexcept
void | libdar::header_version::read (generic_file &f, user_interaction &dialog, bool lax_mode)
| read the header or trailer from the archive
void | libdar::header_version::write (generic_file &f) const
| write down the object to the archive (as header if wrote at the beginning of the archive, as trailer is at the end)
void | libdar::header_version::set_edition (const archive_version &ed)
void | libdar::header_version::set_compression_algo (const compression &zip)
void | libdar::header_version::set_command_line (const std::string &line)
void | libdar::header_version::set_initial_offset (const infinint &offset)
void | libdar::header_version::set_sym_crypto_algo (const crypto_algo &algo)
void | libdar::header_version::set_crypted_key (memory_file *key)
| the object pointed to by key passes to the responsibility of this header_version object
void | libdar::header_version::clear_crypted_key ()
void | libdar::header_version::set_slice_layout (slice_layout *layout)
| the object pointed to by layout is passed under the responsibility of this header_version object
void | libdar::header_version::clear_slice_layout ()
void | libdar::header_version::set_tape_marks (bool presence)
void | libdar::header_version::set_signed (bool is_signed)
void | libdar::header_version::set_salt (const std::string &arg)
void | libdar::header_version::set_iteration_count (const infinint &arg)
void | libdar::header_version::set_kdf_hash (hash_algo algo)
const archive_version & | libdar::header_version::get_edition () const
compression | libdar::header_version::get_compression_algo () const
const std::string & | libdar::header_version::get_command_line () const
const infinint & | libdar::header_version::get_initial_offset () const
bool | libdar::header_version::is_ciphered () const
bool | libdar::header_version::is_signed () const
crypto_algo | libdar::header_version::get_sym_crypto_algo () const
std::string | libdar::header_version::get_sym_crypto_name () const
std::string | libdar::header_version::get_asym_crypto_name () const
memory_file * | libdar::header_version::get_crypted_key () const
const slice_layout * | libdar::header_version::get_slice_layout () const
bool | libdar::header_version::get_tape_marks () const
const std::string & | libdar::header_version::get_salt () const
const infinint & | libdar::header_version::get_iteration_count () const
hash_algo | libdar::header_version::get_kdf_hash () const
void | libdar::header_version::display (user_interaction &dialg) const
void | libdar::header_version::clear ()
void | libdar::header_version::nullifyptr () noexcept
void | libdar::header_version::copy_from (const header_version &ref)
void | libdar::header_version::move_from (header_version &&ref) noexcept
void | libdar::header_version::detruit ()
static bool | libdar::header_version::all_flags_known (U_I flag)
void | libdar::int_tools_swap_bytes (unsigned char &a, unsigned char &b)
void | libdar::int_tools_swap_bytes (unsigned char *a, U_I size)
void | libdar::int_tools_expand_byte (unsigned char a, int_tools_bitfield &bit)
void | libdar::int_tools_contract_byte (const int_tools_bitfield &b, unsigned char &a)
template<class T >
T | libdar::int_tools_rotate_right_one_bit (T v)
template<class T >
T | libdar::int_tools_maxof_agregate (T unused)
trivial_sar * | libdar::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
void | libdar::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, bool multi_threaded, bool header_only)
| setup the given pile object to contain a stack of generic_files suitable to read an archive More...
catalogue * | libdar::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 having this catalogue pointing to the real data (context of isolated catalogue — cata_stack — used to rescue an internal archive — data_stack)
catalogue * | libdar::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
catalogue * | libdar::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 area containing archive's dumped data
catalogue * | libdar::macro_tools_lax_search_catalogue (const std::shared_ptr< user_interaction > &dialog, pile &stack, const archive_version &edition, compression compr_algo, bool info_details, bool even_partial_catalogues, const label &layer1_data_name)
infinint | libdar::macro_tools_get_terminator_start (generic_file &f, const archive_version &reading_ver)
void | libdar::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, 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, bool multi_threaded)
| build layers for a new archive More...
void | libdar::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 More...
range | libdar::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 More...
void | libdar::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. More...
bool | libdar::msg_equivalent (msg_type arg1, msg_type arg2)
bool | libdar::msg_continues (msg_type msg)
char | libdar::msg_type2char (msg_type x)
msg_type | libdar::char2msg_type (char x)
msg_type | libdar::msg_continuation_of (msg_type x)
over_action_ea | libdar::op_tools_crit_ask_user_for_EA_action (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
| ask user for EA action More...
over_action_ea | libdar::op_tools_crit_ask_user_for_FSA_action (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
| ask user for FSA action More...
over_action_data | libdar::op_tools_crit_ask_user_for_data_action (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
| ask user for Data action More...
void | libdar::op_tools_crit_show_entry_info (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
| show information suited for user comparison and decision for entry in conflict More...
std::string | libdar::sar_tools_make_filename (const std::string &base_name, const infinint &num, const infinint &min_digits, const std::string &ext)
bool | libdar::sar_tools_extract_num (const std::string &filename, const std::string &base_name, const infinint &min_digits, const std::string &ext, infinint &ret)
bool | libdar::sar_tools_get_higher_number_in_dir (entrepot &entr, const std::string &base_name, const infinint &min_digits, const std::string &ext, infinint &ret)
std::string | libdar::sar_tools_make_padded_number (const std::string &num, const infinint &min_digits)
void | libdar::tools_init ()
| libdar internal use only: it is launched from get_version() and initializes tools internal variables
void | libdar::tools_end ()
| libdar internal use only: it is launched from close_and_clean() and releases tools internal variables
void | libdar::tools_write_string (generic_file &f, const std::string &s)
| write a string to a file with a '\0' at then end More...
void | libdar::tools_read_string (generic_file &f, std::string &s)
| read a string from a file expecting it to terminate by '\0' More...
void | libdar::tools_write_string_all (generic_file &f, const std::string &s)
| write a string to a file, '\0' has no special meaning nor is added at the end More...
void | libdar::tools_read_string_size (generic_file &f, std::string &s, infinint taille)
| read a string if given size from a file '\0' has no special meaning More...
infinint | libdar::tools_get_filesize (const path &p)
| retrieve the size in byte of a file More...
std::string | libdar::tools_display_integer_in_metric_system (infinint number, const std::string &unit, bool binary)
std::string::iterator | libdar::tools_find_last_char_of (std::string &s, unsigned char v)
| give a pointer to the last character of the given value in the given string More...
void | libdar::tools_blocking_read (int fd, bool mode)
| set blocking/not blocking mode for reading on a file descriptor More...
std::string | libdar::tools_name_of_uid (const infinint &uid)
| convert uid to name in regards to the current system's configuration More...
std::string | libdar::tools_name_of_gid (const infinint &gid)
| convert gid to name in regards of the current system's configuration More...
std::string | libdar::tools_uword2str (U_16 x)
| convert unsigned word to string More...
std::string | libdar::tools_int2str (S_I x)
| convert integer to string More...
std::string | libdar::tools_uint2str (U_I x)
std::string | libdar::tools_addspacebefore (std::string s, U_I expected_size)
| prepend spaces before the given string More...
std::string | libdar::tools_display_date (const datetime &date)
| convert a date in second to its human readable representation More...
char * | libdar::tools_str2charptr (const std::string &x)
| convert a string to a char * More...
U_I | libdar::tools_str2int (const std::string &x)
| convert an integer written in decimal notation to the corresponding value More...
void | libdar::tools_system (user_interaction &dialog, const std::vector< std::string > &argvector)
| wrapper to the "system" system call. More...
void | libdar::tools_system_with_pipe (const std::shared_ptr< user_interaction > &dialog, const std::string &dar_cmd, const std::vector< std::string > &argvpipe)
| wrapper to the "system" system call using anonymous pipe to tranmit arguments to the child process More...
void | libdar::tools_write_vector (generic_file &f, const std::vector< std::string > &x)
| write a list of string to file More...
void | libdar::tools_read_vector (generic_file &f, std::vector< std::string > &x)
| read a list of string from a file More...
std::string | libdar::tools_concat_vector (const std::string &separator, const std::vector< std::string > &x)
| concatenate a vectors of strings in a single string More...
std::vector< std::string > | libdar::operator+ (std::vector< std::string > a, std::vector< std::string > b)
| concatenate two vectors More...
bool | libdar::tools_is_equal_with_hourshift (const infinint &hourshift, const datetime &date1, const datetime &date2)
| test if two dates are equal taking care of a integer hour of difference More...
template<class T >
std::vector< T > | libdar::operator+= (std::vector< T > &a, const std::vector< T > &b)
| template function to add two vectors
std::string | libdar::tools_readlink (const char *root)
| returns the file pointed to by a symbolic link (or transparent if the file is not a symlink). More...
void | libdar::tools_noexcept_make_date (const std::string &chem, bool symlink, const datetime &last_acc, const datetime &last_mod, const datetime &birth)
| set dates of a given file, no exception thrown More...
void | libdar::tools_make_date (const std::string &chemin, bool symlink, const datetime &access, const datetime &modif, const datetime &birth)
| set dates of a given file, may throw exception More...
bool | libdar::tools_is_case_insensitive_equal (const std::string &a, const std::string &b)
| compare two string in case insensitive manner More...
void | libdar::tools_to_upper (const std::string &r, std::string &uppered)
| convert a string to upper case More...
std::string | libdar::tools_printf (const char *format,...)
| make printf-like formating to a std::string More...
std::string | libdar::tools_vprintf (const char *format, va_list ap)
| make printf-like formating to a std::string More...
bool | libdar::tools_do_some_files_match_mask_regex (const entrepot &ent, const std::string &file_mask)
| test the presence of files corresponding to a given mask in a directory (regex mask) More...
void | libdar::tools_unlink_file_mask_regex (user_interaction &dialog, const entrepot &ent, const std::string &file_mask, bool info_details)
| remove files from a given directory More...
void | libdar::tools_avoid_slice_overwriting_regex (user_interaction &dialog, const entrepot &ent, const std::string &basename, const std::string &extension, bool info_details, bool allow_overwriting, bool warn_overwriting, bool dry_run)
| prevents slice overwriting: check the presence of slice and if necessary ask the user if they can be removed More...
bool | libdar::tools_are_on_same_filesystem (const std::string &file1, const std::string &file2)
| tells whether two files are on the same mounted filesystem More...
path | libdar::tools_relative2absolute_path (const path &src, const path &cwd)
| transform a relative path to an absolute one given the current directory value More...
void | libdar::tools_block_all_signals (sigset_t &old_mask)
| block all signals (based on POSIX sigprocmask) More...
void | libdar::tools_set_back_blocked_signals (sigset_t old_mask)
| unblock signals according to given mask More...
U_I | libdar::tools_count_in_string (const std::string &s, const char a)
| counts the number of a given char in a given string More...
datetime | libdar::tools_get_mtime (user_interaction &dialog, const std::string &s, bool auto_zeroing, bool silent, const std::set< std::string > &ignored_as_symlink=std::set< std::string >())
| returns the last modification date of the given file More...
infinint | libdar::tools_get_size (const std::string &s)
| returns the size of the given plain file More...
infinint | libdar::tools_get_extended_size (std::string s, U_I base)
| convert the given string to infinint taking care of multiplication suffixes like k, M, T, etc. More...
std::string | libdar::tools_substitute (const std::string &hook, const std::map< char, std::string > &corres)
| produce the string resulting from the substition of % macro defined in the map More...
std::string | libdar::tools_hook_substitute (const std::string &hook, const std::string &path, const std::string &basename, const std::string &num, const std::string &padded_num, const std::string &ext, const std::string &context, const std::string &base_url)
| produces the string resulting from the substitution of %... macro More...
void | libdar::tools_hook_execute (user_interaction &ui, const std::string &cmd_line)
| execute and retries at user will a given command line More...
void | libdar::tools_hook_substitute_and_execute (user_interaction &ui, const std::string &hook, const std::string &path, const std::string &basename, const std::string &num, const std::string &padded_num, const std::string &ext, const std::string &context, const std::string &base_url)
| subsititue and execute command line More...
std::string | libdar::tools_output2xml (const std::string &src)
| convert string for xml output More...
U_I | libdar::tools_octal2int (const std::string &perm)
| convert octal string to integer More...
std::string | libdar::tools_int2octal (const U_I &perm)
| convert a number to a string corresponding to its octal representation More...
char | libdar::tools_cast_type_to_unix_type (char type)
| change the libdar internal type representation to the usual unix char type
std::string | libdar::tools_get_permission_string (char type, U_32 perm, bool hard)
| convert a permission number into its string representation (rwxrwxrwx)
void | libdar::tools_set_permission (S_I fd, U_I perm)
| change the permission of the file which descriptor is given More...
U_I | libdar::tools_get_permission (S_I fd)
| obtain the permission of the file which descriptor is given More...
uid_t | libdar::tools_ownership2uid (const std::string &user)
| change ownership of the file which descriptor is given More...
uid_t | libdar::tools_ownership2gid (const std::string &group)
| convert string group name or gid to numeric gid value More...
void | libdar::tools_set_ownership (S_I filedesc, const std::string &slice_user, const std::string &slice_group)
| change ownership of the file which descriptor is given More...
void | libdar::tools_memxor (void *dest, const void *src, U_I n)
| Produces in "dest" the XORed value of "dest" and "src". More...
tlv_list | libdar::tools_string2tlv_list (user_interaction &dialog, const U_16 &type, const std::vector< std::string > &data)
| Produces a list of TLV from a constant type and a list of string. More...
U_I | libdar::tools_pseudo_random (U_I max)
| Produces a pseudo random number x, where 0 <= x < max. More...
template<class N , class B >
std::deque< B > | libdar::tools_number_base_decomposition_in_big_endian (N number, const B &base)
| Template for the decomposition of any number in any base (decimal, octal, hexa, etc.) More...
std::string | libdar::tools_unsigned_char_to_hexa (unsigned char x)
| convert a unsigned char into its hexa decima representation More...
std::string | libdar::tools_string_to_hexa (const std::string &input)
| convert a string into its hexadecima representation More...
infinint | libdar::tools_file_size_to_crc_size (const infinint &size)
| Defines the CRC size to use for a given filesize. More...
std::string | libdar::tools_getcwd ()
| get current working directory
std::string | libdar::tools_get_compression_ratio (const infinint &storage_size, const infinint &file_size, bool compressed)
| return the string about compression ratio
std::string | libdar::tools_strerror_r (int errnum)
| wrapper routine to strerror_r
struct dirent * | libdar::tools_allocate_struct_dirent (const std::string &path_name, U_64 &max_name_length)
void | libdar::tools_release_struct_dirent (struct dirent *ptr)
void | libdar::tools_secu_string_show (user_interaction &dialog, const std::string &msg, const secu_string &key)
| display the content of a secu_string, this function is only for trouble shooting!
template<class T >
T | libdar::tools_max (T a, T b)
template<class T >
T | libdar::tools_min (T a, T b)
void | libdar::tools_unlink (const std::string &filename)
| remove from filesystem the file which path is given
std::string | libdar::tools_escape_chars_in_string (const std::string &val, const char *to_escape)
| escape with a anti-slash character a set of chars found in the given string
bool | libdar::tools_infinint2U_64 (infinint val, U_64 &res)
| convert an infinint to U_64 (aka "uint64_t" or yet "unsigned long long") More...
bool | libdar::tools_my_atoi (const char *a, U_I &val)
| ascii to integer conversion More...
infinint | libdar::tools_double2infinint (double arg)
| convert a double (float) to infinint (integer) taking care of rounding it to the closest value
template<class T >
void | libdar::tools_check_negative_date (T &val, user_interaction &ui, const char *inode_path, const char *nature, bool ask_before, bool silent)
| check the value is not negative, and if asked set it to zero More...
infinint | libdar::tools_upper_rounded_log2 (const infinint &ref)
| compute an approximate log2 of the argument
infinint | libdar::tools_lower_rounded_exp2 (const infinint &ref)
| compute an approximate exp2 of the argument
infinint | libdar::tools_rounded_square_root (const infinint &ref)
| compute an approximate square root of the argument
infinint | libdar::tools_rounded_cube_root (const infinint &ref)
| compute an approximate cube root of the argument
std::string | libdar::sar_make_filename (const std::string &base_name, const infinint &num, const infinint &min_digits, const std::string &ext)
| return the name of a slice given the base_name, slice number and extension
template<class T >
bool | libdar::pile::pop_and_close_if_type_is (T *ptr)
| remove the top generic_file and destroy it More...
template<class T >
void | libdar::pile::find_first_from_top (T *&ref) const
| this template let the class user find out the higher object on the stack of the given type More...
template<class T >
void | libdar::pile::find_first_from_bottom (T *&ref) const
| this template is similar to the template "find_first_from_top" except that the search is started from the bottom of the stack
void | libdar::storage::iterator::skip_plus_one ()
void | libdar::storage::iterator::skip_less_one ()

## Variables
static constexpr unsigned int | libdar::generic_thread::tampon_block_size = 102401
static constexpr unsigned int | libdar::generic_thread::tampon_num_block = 1000
static constexpr unsigned int | libdar::generic_thread::tampon_block_size_ctrl = 1024
static constexpr unsigned int | libdar::generic_thread::tampon_num_block_ctrl = 10
libthreadar::fast_tampon< char > | libdar::generic_thread::toslave_data
libthreadar::fast_tampon< char > | libdar::generic_thread::tomaster_data
libthreadar::fast_tampon< char > | libdar::generic_thread::toslave_ctrl
libthreadar::fast_tampon< char > | libdar::generic_thread::tomaster_ctrl
slave_thread * | libdar::generic_thread::remote
bool | libdar::generic_thread::reached_eof
| whether we reached end of file
char | libdar::generic_thread::data_header
| contains 1 byte header for data
char | libdar::generic_thread::data_header_eof
| contains 1 byte header for data + eof
bool | libdar::generic_thread::running
| whether a remote is expected to run, tid is then set
pthread_t | libdar::generic_thread::tid
| thread id of remote
messaging_encode | libdar::generic_thread::order
messaging_decode | libdar::generic_thread::answer
unsigned int | libdar::generic_thread::num
char * | libdar::generic_thread::ptr
label | libdar::generic_thread::dataname
const U_32 | libdar::SAUV_MAGIC_NUMBER = 123
archive_version | libdar::header_version::edition
| archive format
compression | libdar::header_version::algo_zip
| compression algorithm used
std::string | libdar::header_version::cmd_line
| used long ago to store cmd_line, then abandonned, then recycled as a user comment field
infinint | libdar::header_version::initial_offset
| defines at which offset starts the archive (passed the archive header), this field is obiously only used in the trailer not in the header
crypto_algo | libdar::header_version::sym
| strong encryption algorithm used for symmetrical encryption
memory_file * | libdar::header_version::crypted_key
| optional field containing the asymmetrically ciphered key used for strong encryption ciphering
slice_layout * | libdar::header_version::ref_layout
| optional field used in isolated catalogues to record the slicing layout of their archive of reference
bool | libdar::header_version::has_tape_marks
| whether the archive contains tape marks aka escape marks aka sequence marks
bool | libdar::header_version::ciphered
| whether the archive is ciphered, even if we do not know its crypto algorithm (old archives)
bool | libdar::header_version::arch_signed
| whether the archive is signed
std::string | libdar::header_version::salt
| used for key derivation
infinint | libdar::header_version::iteration_count
| used for key derivation
hash_algo | libdar::header_version::kdf_hash
| used for key derivation
static constexpr U_I | libdar::header_version::FLAG_SAVED_EA_ROOT = 0x80
| no more used since version "05"
static constexpr U_I | libdar::header_version::FLAG_SAVED_EA_USER = 0x40
| no more used since version "05"
static constexpr U_I | libdar::header_version::FLAG_SCRAMBLED = 0x20
| scrambled or strong encryption used
static constexpr U_I | libdar::header_version::FLAG_SEQUENCE_MARK = 0x10
| escape sequence marks present for sequential reading
static constexpr U_I | libdar::header_version::FLAG_INITIAL_OFFSET = 0x08
| whether the header contains the initial offset (size of clear data before encrypted) NOTE : This value is set internally by header_version, no need to set flag with it! But that's OK to set it or not, it will be updated according to initial_offset's value.
static constexpr U_I | libdar::header_version::FLAG_HAS_CRYPTED_KEY = 0x04
| the header contains a symmetrical key encrypted with asymmetrical algorithm
static constexpr U_I | libdar::header_version::FLAG_HAS_REF_SLICING = 0x02
| the header contains the slicing information of the archive of reference (used for isolated catalogue)
static constexpr U_I | libdar::header_version::FLAG_HAS_AN_EXTENDED_SIZE = 0x01
| the flag is two bytes length
static constexpr U_I | libdar::header_version::FLAG_ARCHIVE_IS_SIGNED = 0x0200
| archive is signed
static constexpr U_I | libdar::header_version::FLAG_HAS_KDF_PARAM = 0x0400
| archive header contains salt and non default interaction count
static constexpr U_I | libdar::header_version::FLAG_HAS_AN_SECOND_EXTENDED_SIZE = 0x0101
| reserved for future use
static constexpr U_I | libdar::header_version::PRE_FORMAT_10_ITERATION = 2000
| fixed value used for key derivation before archive format 10
const label | libdar::label_zero
constexpr U_I | libdar::GLOBAL_ELASTIC_BUFFER_SIZE = 51200
const archive_version | libdar::macro_tools_supported_version
const std::string | libdar::LIBDAR_STACK_LABEL_UNCOMPRESSED
const std::string | libdar::LIBDAR_STACK_LABEL_CLEAR
const std::string | libdar::LIBDAR_STACK_LABEL_UNCYPHERED
const std::string | libdar::LIBDAR_STACK_LABEL_LEVEL1
const int | libdar::WR_OK = 0
const int | libdar::WR_MEM_ERROR = 1
const int | libdar::WR_VERSION_ERROR = 2
const int | libdar::WR_STREAM_ERROR = 3
const int | libdar::WR_DATA_ERROR = 4
const int | libdar::WR_NO_FLUSH = 5
const int | libdar::WR_BUF_ERROR = 6
const int | libdar::WR_STREAM_END = 7
const int | libdar::WR_FINISH = 8
constexpr unsigned char | libdar::ANSWER_TYPE_DATA = 'D'
constexpr unsigned char | libdar::ANSWER_TYPE_INFININT = 'I'
constexpr U_I | libdar::REQUEST_SIZE_SPECIAL_ORDER = 0
constexpr U_I | libdar::REQUEST_OFFSET_END_TRANSMIT = 0
constexpr U_I | libdar::REQUEST_OFFSET_GET_FILESIZE = 1
constexpr U_I | libdar::REQUEST_OFFSET_CHANGE_CONTEXT_STATUS = 2
constexpr U_I | libdar::REQUEST_IS_OLD_START_END_ARCHIVE = 3
constexpr U_I | libdar::REQUEST_GET_DATA_NAME = 4
constexpr U_I | libdar::REQUEST_FIRST_SLICE_HEADER_SIZE = 5
constexpr U_I | libdar::REQUEST_OTHER_SLICE_HEADER_SIZE = 6

## Detailed Description

Libdar internal symbols.

Understanding this is not necessary to use libdar through the API. This is libdar internal code documentation

## Enumeration Type Documentation

## ◆ capa_status

enum libdar::capa_status

the EFFECTIVE set the value of the associated capability for the calling thread

returned by the capability_* routines

Enumerator
capa_set | current thread has the requested capability
capa_clear | current thread has not the requested capability

Definition at line 41 of file capabilities.hpp.

## ◆ ea_saved_status

enum libdar::ea_saved_status
| strong

EA saved status for an entry.

Enumerator
none | no EA present for this inode in filesystem
partial | EA present in filesystem but not stored (ctime used to check changes)
fake | EA present in filesystem but not attached to this inode (isolation context) no more used in archive version "08" and above, ea_partial or ea_full stays a valid status in isolated catalogue because pointers to EA and data are no more removed during isolation process.
full | EA present in filesystem and attached to this inode.
removed | EA were present in the reference version, but not present anymore.

Definition at line 55 of file cat_status.hpp.

## ◆ fsa_saved_status

enum libdar::fsa_saved_status
| strong

FSA saved status for an entry.

there is not "remove status for FSA, either the cat_inode contains full copy of FSA or only remembers the families of FSA found in the unchanged cat_inode FSA none is used when the file has no FSA because:

- either the underlying filesystem has no known FSA
- or the underlying filesystem FSA support has not been activated at compilation time
- or the fsa_scope requested at execution time exclude the filesystem FSA families available here

Enumerator
none | no FSA saved
partial | FSA unchanged, not fully stored.
full | FSA saved.

Definition at line 73 of file cat_status.hpp.

## ◆ gf_mode

enum libdar::gf_mode

generic_file openning modes

Enumerator
gf_read_only | read only access
gf_write_only | write only access
gf_read_write | read and write access

Definition at line 43 of file gf_mode.hpp.

## ◆ saved_status

enum libdar::saved_status
| strong

data saved status for an entry

Enumerator
saved | inode is saved in the archive
inode_only | data is not saved but inode meta data has changed since the archive of reference
fake | inode is not saved in the archive but is in the archive of reference (isolation context) s_fake is no more used in archive format "08" and above: isolated catalogue do keep the data pointers and s_saved stays a valid status in isolated catalogues.
not_saved | inode is not saved in the archive
delta | inode is saved but as delta binary from the content (delta signature) of what was found in the archive of reference

Definition at line 44 of file cat_status.hpp.

## Function Documentation

## ◆ database_header_create()

generic_file* libdar::database_header_create | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | const std::string & | filename,
|  | bool | overwrite,
|  | compression | algozip
| ) |  |

create the header for a dar_manager database

Parameters

  [in] | dialog | is used for user interaction
  [in] | filename | is the file's name to create/overwrite
  [in] | overwrite | set to true to allow file overwriting (else generates an error if file exists)
  [in] | algozip | compression algorithm used for the database

Returns
  the database header has been read and checked the database can now be read from the returned generic_file pointed by the returned value then it must be destroyed with the delete operator.

## ◆ database_header_open()

generic_file* libdar::database_header_open | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | const std::string & | filename,
|  | unsigned char & | db_version,
|  | compression & | algozip
| ) |  |

read the header of a dar_manager database

Parameters

  [in] | dialog | for user interaction
  [in] | filename | is the filename to read from
  [out] | db_version | version of the database
  [out] | algozip | compression algorithm used in the database

Returns
  the generic_file where the database header has been put

## ◆ ea_filesystem_clear_ea()

void libdar::ea_filesystem_clear_ea | ( | const std::string & | name,
|  | const mask & | filter
| ) |  |

remove all EA of a given file that match a given mask

Parameters

  [in] | name | is the filename which EA must be altered
  [in] | filter | is a mask that defines which EA names have to be removed

Note
  unless the given mask is logically equivalent to bool_mask(true) some EA may remain associated to the file after the operation.

## ◆ ea_filesystem_has_ea() [1/2]

bool libdar::ea_filesystem_has_ea | ( | const std::string & | name | ) |

test the presence of EA for a given file

Parameters

  [in] | name | is the filename which EA presence must be check against

Returns
  true if at least one EA has been found

## ◆ ea_filesystem_has_ea() [2/2]

bool libdar::ea_filesystem_has_ea | ( | const std::string & | name,
|  | const mask & | filter
| ) |  |

test the presence of EA for a given file

Parameters

  [in] | name | is the filename which EA presence must be check against
  [in] | filter | is a mask that defines which attributes names to only consider

Returns
  true if at least one EA has been found

## ◆ ea_filesystem_read_ea()

ea_attributs* libdar::ea_filesystem_read_ea | ( | const std::string & | chemin,
|  | const mask & | filter
| ) |  |

read EA associated to a given file

Parameters

  [in] | chemin | is the path to the file to read attributes of
  [in] | filter | is a mask that defines which attributes names have to be considered only

Returns
  nullptr if no EA have been found under the specified mask, or returns a newly allocated object that the caller has the responsibility to delete when no more needed

## ◆ ea_filesystem_write_ea()

bool libdar::ea_filesystem_write_ea | ( | const std::string & | chemin,
|  | const ea_attributs & | val,
|  | const mask & | filter
| ) |  |

overwrite some attribute to a given file's attribute list

Parameters

  [in] | chemin | is the path of the file to write attribute to
  [in] | val | is a list of attribute amoung which a subset will be added to file's attribute list
  [in] | filter | a mask that define which attribute's names will be written and which will be ignored from the given list

Returns
  true if some attribute could be set

Note
  if an EA is already present, it is not modified unless the mask covers its name and a value is available for that attribute name in the given list.

## ◆ filesystem_tools_create_non_existing_file_based_on()

fichier_local* libdar::filesystem_tools_create_non_existing_file_based_on | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | std::string | filename,
|  | path | where,
|  | std::string & | new_filename
| ) |  |

create in dirname a brand-new filename which name derives from filename

Returns
  a read-write object the caller has the duty to destroy, exception thrown if no filename could be created

## ◆ filtre_merge_step0()

void libdar::filtre_merge_step0 | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | const catalogue * | ref1,
|  | const catalogue * | ref2,
|  | statistics & | st,
|  | bool | decremental_mode,
|  | crit_action *& | decr,
|  | const crit_action *& | overwrite,
|  | bool & | abort,
|  | thread_cancellation & | thr_cancel
| ) |  |

initialize variables used for merging in step1 and step2

Note
  also used for repairing

## ◆ filtre_merge_step2()

void libdar::filtre_merge_step2 | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | const pile_descriptor & | pdesc,
|  | catalogue & | cat,
|  | bool | info_details,
|  | bool | display_treated,
|  | bool | display_treated_only_dir,
|  | const mask & | compr_mask,
|  | const infinint & | min_compr_size,
|  | bool | keep_compressed,
|  | const infinint & | sparse_file_min_size,
|  | bool | delta_signature,
|  | bool | build_delta_sig,
|  | const infinint & | delta_sig_min_size,
|  | const mask & | delta_mask,
|  | bool & | abort,
|  | thread_cancellation & | thr_cancel,
|  | bool | repair_mode,
|  | const delta_sig_block_size & | signature_block_size
| ) |  |

copies data of "cat" catalogue to the pdesc of a brand new archive

Note
  also used for repairing

## ◆ filtre_restore()

void libdar::filtre_restore | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | const mask & | filtre,
|  | const mask & | subtree,
|  | const catalogue & | cat,
|  | const path & | fs_racine,
|  | bool | fs_warn_overwrite,
|  | bool | info_details,
|  | bool | display_treated,
|  | bool | display_treated_only_dir,
|  | bool | display_skipped,
|  | statistics & | st,
|  | const mask & | ea_mask,
|  | bool | flat,
|  | comparison_fields | what_to_check,
|  | bool | warn_remove_no_match,
|  | bool | empty,
|  | bool | empty_dir,
|  | const crit_action & | x_overwrite,
|  | archive_options_extract::t_dirty | dirty,
|  | bool | only_deleted,
|  | bool | not_deleted,
|  | const fsa_scope & | scope
| ) |  |

Parameters

  dialog | for user interaction
  filtre | which filename to restore
  subtree | which directory and paths to restore
  cat | table of content to extract information from
  fs_racine | root path under which to restore directiry tree and files
  fs_warn_overwrite | whether to warn before overwriting (to be replaced by overwriting policy)
  info_details | whether to display processing messages
  display_treated | whether to display treated files
  display_treated_only_dir | whether to only display current directory of treated file
  display_skipped | whether to display skipped files
  st | statistics result about the operation
  ea_mask | defines EA to restore/not restore
  flat | if true, directories are not restores, all files are placed directly at in fs_racine directory
  what_to_check | which file properties to restore
  warn_remove_no_match | wether to warn for file to remove not matching the expected type
  empty | dry-run execution
  empty_dir | whether to restore directories that do contain any file to restore
  x_overwrite | how and whether to overwrite files
  dirty | whether to restore dirty files
  only_deleted | whether to only consider deleted files
  not_deleted | wether to consider deleted files
  scope | scope of FSA to take into account

## ◆ find_first_from_top()

template<class T >

void libdar::pile::find_first_from_top | ( | T *& | ref | ) | const

this template let the class user find out the higher object on the stack of the given type

Parameters

  [in,out] | ref | gives the type of the object to look for, and gets the address of the first object found starting from the top

Note
  if no object of that type could be found in the stack ref is set to nullptr

Definition at line 202 of file pile.hpp.

## ◆ generic_thread()

libdar::generic_thread::generic_thread | ( | generic_file * | ptr,
|  | U_I | data_block_size = `tampon_block_size`,
|  | U_I | data_num_block = `tampon_num_block`,
|  | U_I | ctrl_block_size = `tampon_block_size_ctrl`,
|  | U_I | ctrl_num_block = `tampon_num_block_ctrl`
| ) |  |

constructor

Parameters

  [in] | ptr | is the generic_file that will be read from/written to by a separated thread
  [in] | data_block_size | is the size of block used to pass information to and from the remote thread
  [in] | data_num_block | maximum number of blocks that can be sent without being retrieved by the other threads
  [in] | ctrl_block_size | is the size of block used to pass control information between threads
  [in] | ctrl_num_block | is the max number of block on-fly for control information between threads

Note
  that the pointed to generic_file must exist during the whole life of the generic_thread. Its memory management after the generic_thread has died is under the responsibility of the caller of the generic_thread

## ◆ inherited_flush_read()

virtual void libdar::generic_thread::inherited_flush_read | ( |  | ) |
| override protected virtual

reset internal engine, flush caches in order to read the data at current position

Note
  when the object relies on external object or system object to fetch the data from for reading, when a call to (inherited_)flush_read() occurs, the current object must not assume that any previously read data is still valid if it has internal buffers or the like and it should flush them asap. This call must not propagate the flush_read to any other gneric_file object it could rely on

Implements libdar::generic_file.

## ◆ inherited_read()

virtual U_I libdar::generic_thread::inherited_read | ( | char * | a,
|  | U_I | size
| ) |  |
| override protected virtual

implementation of read() operation

Parameters

  [in,out] | a | where to put the data to read
  [in] | size | says how much data to read

Returns
  the exact amount of data read and put into 'a'

Note
  read as much byte as requested, up to end of file stays blocked if not enough data is available and EOF not yet met. May return less data than requested only if EOF as been reached. in other worlds, EOF is reached when returned data is stricly less than the requested data Any problem shall be reported by throwing an exception.

Implements libdar::generic_file.

## ◆ inherited_read_ahead()

virtual void libdar::generic_thread::inherited_read_ahead | ( | const infinint & | amount | ) |
| override protected virtual

tells the object that several calls to read() will follow to probably obtain at least the given amount of data

Parameters

  [in] | amount | is the maximum expected amount of data that is known to be read

Note
  this call may be implemented as a do-nothing call, its presence is only to allow optimization when possible, like in multi-threaded environment

Implements libdar::generic_file.

## ◆ inherited_sync_write()

virtual void libdar::generic_thread::inherited_sync_write | ( |  | ) |
| override protected virtual

generic_file inherited method to sync all pending writes

Note
  no data in transit in this object so we should not do anything, however for performance propagating the order to slave_thread

Implements libdar::generic_file.

## ◆ inherited_terminate()

virtual void libdar::generic_thread::inherited_terminate | ( |  | ) |
| override protected virtual

destructor-like call, except that it is allowed to throw exceptions

Note
  this method must never be called directly but using terminate() instead, generic_file class manages it to never be called more than once

Implements libdar::generic_file.

## ◆ inherited_write()

virtual void libdar::generic_thread::inherited_write | ( | const char * | a,
|  | U_I | size
| ) |  |
| override protected virtual

implementation of the write() operation

Parameters

  [in] | a | what data to write
  [in] | size | amount of data to write

Note
  must either write all data or report an error by throwing an exception

Implements libdar::generic_file.

## ◆ macro_tools_close_layers()

void libdar::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

Parameters

  [in] | dialog | for user interaction
  [in] | layers | the archive layers to close
  [in] | ver | the archive "header" to be dropped at end of archive
  [in] | cat | the catalogue to dump in the layer before closing the archive
  [in] | info_details | whether to display detailed information
  [in] | crypto | cipher algorithm used in "layers"
  [in] | gnupg_recipients | used sign the catalog, use an empty vector if there is no signatories (no nedd to sign the hash of the catalogue)
  [in] | gnupg_signatories | used to sign the catalog, use an empty vector to disable signning
  [in] | algo | compression algorithm used
  [in] | empty | dry-run execution (null_file at bottom of the stack)

## ◆ macro_tools_create_layers()

void libdar::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,
|  | 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,
|  | bool | multi_threaded
| ) |  |

build layers for a new archive

Parameters

  [in] | dialog | for user interaction
  [out] | layers | the resulting stack of generic_file layers ready for use
  [out] | ver | the archive "header" to be dropped at end of archive
  [out] | slicing | slicing layout of the archive
  [in] | ref_slicing | if not nullptr the pointed to slicing_layout will be stored in the header/trailer version of the archive
  [in] | sauv_path_t | where to create the archive
  [in] | filename | archive base name
  [in] | extension | archive extension
  [in] | allow_over | whether to allow slice overwriting
  [in] | warn_over | whether to warn before overwriting
  [in] | info_details | whether to display detailed information
  [in] | pause | how many slices to wait before pausing (0 to never wait)
  [in] | algo | compression algorithm
  [in] | compression_level | compression level
  [in] | file_size | size of the slices
  [in] | first_file_size | size of the first slice
  [in] | execute | command to execute after each slice creation
  [in] | crypto | cipher algorithm to use
  [in] | pass | password/passphrase to use for encryption
  [in] | crypto_size | size of crypto blocks
  [in] | gnupg_recipients | list of email recipients'public keys to encrypt a randomly chosen key with
  [in] | gnupg_signatories | list of email which associated signature has to be used to sign the archive
  [in] | empty | dry-run execution (null_file at bottom of the stack)
  [in] | slice_permission | permission to set the slices to
  [in] | add_marks_for_sequential_reading | whether to add an escape layer in the stack
  [in] | user_comment | user comment to add into the slice header/trailer
  [in] | hash | algorithm to use for slices hashing
  [in] | slice_min_digits | minimum number of digits slice number must have
  [in] | internal_name | common label to all slices
  [in] | data_name | to use in slice header
  [in] | iteration_count | used for key derivation when passphrase is human provided
  [in] | kdf_hash | hash algorithm used for the key derivation function
  [in] | multi_threaded | true if libdar can spawn several thread to work

Note
  the stack has the following contents depending on given options

+-top LIBDAR_STACK_LABEL_ +-------------------------------------------—+------------------—+ | [ generic_thread ] | | | compressor | | +-------------------------------------------—+------------------—+ | [ generic_thread ] | | | [ escape ] | | +– - - - - - - - - - - - - - - - - - - - - - -+------------------—+ | [ generic_thread (if crypt or scam is used) ]| | | cache | crypto_sym | scrambler | | | [ cache ] |_CACHE_PIPE | | trivial_sar | null_file | sar | | +-------------------------------------------—+------------------—+ +-bottom

Note
  the bottom cache layer is only present when trivial_sar is used to write on a pipe. trivial_sar used to write a non sliced archive does not use a cache layer above it
  the top cache is only used in place of crypto_sym or scrambler when no encryption is required and the cache layer labelled _CACHE_PIPE is absent.
  escape layer is present by default unless tape marks have been disabled
  the generic_thread are inserted in the stack if multi-threading is possible and allowed

## ◆ macro_tools_get_slices()

range libdar::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

Parameters

  [in] | obj | a pointer to the object which data & EFSA is to be located
  [in] | sl | slice layout of the archive

Returns
  a set of slices which will be required to restore that particular file (over the slice(s) containing the catalogue of course).

## ◆ macro_tools_open_archive()

void libdar::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,
|  | bool | multi_threaded,
|  | bool | header_only
| ) |  |

setup the given pile object to contain a stack of generic_files suitable to read an archive

Note
  the stack has the following contents depending on given options

+-top LIBDAR_STACK_LABEL_ +-------------------------------------------—+------------------—+ | [ generic_thread ] |_UNCOMPRESSED | | compressor |v v v | +-------------------------------------------—+------------------—+ | [ generic_thread ] |_CLEAR | | [ escape ] |v v v | +-------------------------------------------—+v—v—v---------—+ | [ generic_thread ] |_UNCYPHERED | | [ cache ] | crypto_sym | scrambler |v v v | | [ tronc ] |LEVEL 1 | | trivial_sar | zapette | sar |v v v | +-------------------------------------------—+------------------—+ +-bottom

Note
  generic_thread objects are only present in the stack if multi-thread is active
  escape is present unless tape mark have been disabled at archive creation time
  tronc is not present in sequential read mode
  cache layer is present only in absence of encryption and when no escape layer is above
  _UNCOMPRESSED label is associated to the top of the stack
  _CLEAR is associated to the generic_thread below compressor else escape else the cache or crypto_sym or scrambler which then has two Labels (_CLEAR and _UNCYPHERED)

Parameters

  dialog | for user interaction
  where | slices location
  basename | slice basename
  min_digits | minimum digits for the slice number
  extension | slice extensions
  crypto | encryption algorithm
  pass | pass key for crypto/scrambling
  crypto_size | crypto block size
  stack | the stack of generic_file resulting of the archive openning
  ver | header read from raw data
  input_pipe | named pipe for input when basename is "-" (dar_slave)
  output_pipe | named pipe for output when basename is "-" (dar_slave)
  execute | command to execute between slices
  second_terminateur_offset | where to start looking for the second terminateur (set to zero if there is only one terminateur).
  lax | whether we skip&warn the usual verifications
  has_external_cat | true if the catalogue will not be read from the current archive (flag used in lax mode only)
  sequential_read | whether to use the escape sequence (if present) to get archive contents and proceed to sequential reading
  info_details | be or not verbose about the archive openning
  gnupg_signed | list of existing signature found for that archive (valid or not)
  sl | slicing layout of the archive
  multi_threaded | true if several thread shall be run concurrently by libdar
  header_only | if true, stop the process before openning the encryption layer

## ◆ macro_tools_open_pipes()

void libdar::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.

Parameters

  [in,out] | dialog | for user interaction
  [in] | input | path to the input named pipe
  [in] | output | path to the output named pipe
  [out] | in | resulting tuyau object for input
  [out] | out | resulting tuyau object for output

Note
  in and out parameters must be released by the caller thanks to the "delete" operator

## ◆ op_tools_crit_ask_user_for_data_action()

over_action_data libdar::op_tools_crit_ask_user_for_data_action | ( | user_interaction & | dialog,
|  | const std::string & | full_name,
|  | const cat_entree * | already_here,
|  | const cat_entree * | dolly
| ) |  |

ask user for Data action

Parameters

  [in] | dialog | for user interaction
  [in] | full_name | full path to the entry do ask decision for
  [in] | already_here | pointer to the object 'in place'
  [in] | dolly | pointer to the object 'to be added'

Returns
  the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception

## ◆ op_tools_crit_ask_user_for_EA_action()

over_action_ea libdar::op_tools_crit_ask_user_for_EA_action | ( | user_interaction & | dialog,
|  | const std::string & | full_name,
|  | const cat_entree * | already_here,
|  | const cat_entree * | dolly
| ) |  |

ask user for EA action

Parameters

  [in] | dialog | for user interaction
  [in] | full_name | full path to the entry do ask decision for
  [in] | already_here | pointer to the object 'in place'
  [in] | dolly | pointer to the object 'to be added'

Returns
  the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception

## ◆ op_tools_crit_ask_user_for_FSA_action()

over_action_ea libdar::op_tools_crit_ask_user_for_FSA_action | ( | user_interaction & | dialog,
|  | const std::string & | full_name,
|  | const cat_entree * | already_here,
|  | const cat_entree * | dolly
| ) |  |

ask user for FSA action

Parameters

  [in] | dialog | for user interaction
  [in] | full_name | full path to the entry do ask decision for
  [in] | already_here | pointer to the object 'in place'
  [in] | dolly | pointer to the object 'to be added'

Returns
  the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception

## ◆ op_tools_crit_show_entry_info()

void libdar::op_tools_crit_show_entry_info | ( | user_interaction & | dialog,
|  | const std::string & | full_name,
|  | const cat_entree * | already_here,
|  | const cat_entree * | dolly
| ) |  |

show information suited for user comparison and decision for entry in conflict

Parameters

  [in] | dialog | for user interaction
  [in] | full_name | path to the entry of the entry to display information
  [in] | already_here | pointer to the object 'in place'
  [in] | dolly | pointer to the object 'to be added'

## ◆ operator+()

std::vector<std::string> libdar::operator+ | ( | std::vector< std::string > | a,
|  | std::vector< std::string > | b
| ) |  |

concatenate two vectors

Parameters

  [in] | a | the first vector
  [in] | b | the second vector

Returns
  a vector containing the elements of a and the element of b

## ◆ pop_and_close_if_type_is()

template<class T >

bool libdar::pile::pop_and_close_if_type_is | ( | T * | ptr | ) |

remove the top generic_file and destroy it

Parameters

  [in] | ptr | is the type of the object that must be found on the top of the stack, It may also be the type of a parent class. Note that the value of the pointer is ignored.

Returns
  true if and only if the object on the top of the stack could be matched to the given type, this object is then poped from the stack and destroyed.

Definition at line 180 of file pile.hpp.

References libdar::pile::top().

## ◆ read_answer()

void libdar::generic_thread::read_answer | ( |  | ) |
| private

Note
  ptr must be released/recycled after this call

## ◆ skip()

virtual bool libdar::generic_thread::skip | ( | const infinint & | pos | ) |
| override virtual

skip at the absolute position

Parameters

  [in] | pos | the offset in byte where next read/write operation must start

Returns
  true if operation was successfull and false if the requested position is not valid (after end of file)

Note
  if requested position is not valid the reading/writing cursor must be set to the closest valid position

Implements libdar::generic_file.

## ◆ skippable()

virtual bool libdar::generic_thread::skippable | ( | skippability | direction,
|  | const infinint & | amount
| ) |  |
| override virtual

whether the implementation is able to skip

Note
  the capability to skip does not mean that skip_relative() or skip() will succeed, but rather that the inherited class implementation does not by construction forbid the requested skip (like inherited class providing a generic_file interface of an anonymous pipe for example)

Implements libdar::generic_file.

## ◆ tools_addspacebefore()

std::string libdar::tools_addspacebefore | ( | std::string | s,
|  | U_I | expected_size
| ) |  |

prepend spaces before the given string

Parameters

  [in] | s | the string to append spaces to
  [in] | expected_size | the minimum size of the resulting string

Returns
  a string at least as much long as expected_size with prepended leading spaces if necessary

## ◆ tools_allocate_struct_dirent()

struct dirent* libdar::tools_allocate_struct_dirent | ( | const std::string & | path_name,
|  | U_64 & | max_name_length
| ) |  |

allocate a new dirent structure for use with readdir_r

Parameters

  [in] | path_name | is the path of to the directory (and its underlying filesystem) where the resulting dirent will be used. Depending on fileystem, the size of the dirent structure may vary it is necessary to know the directory where the corresponding files resides
  [out] | max_name_length | is the maximum filename length allocated in the returned structure

Returns
  a pointer to the newly allocated dirent structure

## ◆ tools_are_on_same_filesystem()

bool libdar::tools_are_on_same_filesystem | ( | const std::string & | file1,
|  | const std::string & | file2
| ) |  |

tells whether two files are on the same mounted filesystem

Parameters

  [in] | file1 | first file
  [in] | file2 | second file

Returns
  true if the two files are located under the same mounting point

Note
  if one of the file is not present or if the filesystem information is not possible to be read an exception is throw (Erange)

## ◆ tools_avoid_slice_overwriting_regex()

void libdar::tools_avoid_slice_overwriting_regex | ( | user_interaction & | dialog,
|  | const entrepot & | ent,
|  | const std::string & | basename,
|  | const std::string & | extension,
|  | bool | info_details,
|  | bool | allow_overwriting,
|  | bool | warn_overwriting,
|  | bool | dry_run
| ) |  |

prevents slice overwriting: check the presence of slice and if necessary ask the user if they can be removed

Parameters

  [in,out] | dialog | for user interaction
  [in] | ent | entrepot where to check for slice overwriting
  [in] | basename | is the archive basename
  [in] | extension | is the archive filename extension
  [in] | info_details | whether user must be displayed details of the operation
  [in] | allow_overwriting | whether overwriting is allowed by the user
  [in] | warn_overwriting | whether a warning must be issued before overwriting (if allowed)
  [in] | dry_run | do a dry-run exection (no filesystem modification is performed)

Note
  may thow exceptions.

## ◆ tools_block_all_signals()

void libdar::tools_block_all_signals | ( | sigset_t & | old_mask | ) |

block all signals (based on POSIX sigprocmask)

Parameters

  [out] | old_mask | is set to the old mask value (for later unmasking signals)

Exceptions

  Erange | is thrown if system call failed for some reason

## ◆ tools_blocking_read()

void libdar::tools_blocking_read | ( | int | fd,
|  | bool | mode
| ) |  |

set blocking/not blocking mode for reading on a file descriptor

Parameters

  [in] | fd | file descriptor to read on
  [in] | mode | set to true for a blocking read and to false for non blocking read

## ◆ tools_check_negative_date()

template<class T >

void libdar::tools_check_negative_date | ( | T & | val,
|  | user_interaction & | ui,
|  | const char * | inode_path,
|  | const char * | nature,
|  | bool | ask_before,
|  | bool | silent
| ) |  |

check the value is not negative, and if asked set it to zero

Parameters

  [in,out] | val | variable which value to check
  [in,out] | ui | for user interaction if necessary
  [in] | inode_path | to the inode for message info
  [in] | nature | type of the date/time (mtime,atime,ctime,birthtime,...)
  [in] | ask_before | whether to just warn or ask user for confirmation
  [in] | silent | if set, do not warn nor ask

Definition at line 686 of file tools.hpp.

References libdar::tools_printf().

## ◆ tools_concat_vector()

std::string libdar::tools_concat_vector | ( | const std::string & | separator,
|  | const std::vector< std::string > & | x
| ) |  |

concatenate a vectors of strings in a single string

Parameters

  [in] | separator | string to insert between two elements
  [in] | x | the list string

Returns
  the result of the concatenation of the members of the list with separtor between two consecutive members

## ◆ tools_count_in_string()

U_I libdar::tools_count_in_string | ( | const std::string & | s,
|  | const char | a
| ) |  |

counts the number of a given char in a given string

Parameters

  [in] | s | string to look inside of
  [in] | a | char to look for

Returns
  the number of char found

## ◆ tools_display_date()

std::string libdar::tools_display_date | ( | const datetime & | date | ) |

convert a date in second to its human readable representation

Parameters

  [in] | date | the date in second

Returns
  the human representation corresponding to the argument

## ◆ tools_display_integer_in_metric_system()

std::string libdar::tools_display_integer_in_metric_system | ( | infinint | number,
|  | const std::string & | unit,
|  | bool | binary
| ) |  |

convert an integer to its decimal representation with the highest unit of metric system

Parameters

  [in] | number | is the integer to convert
  [in] | unit | unit symbol (o for octet, m for meter, etc.) to apply metric system to, this may be nullptr
  [in] | binary | if set to true using the ki, Gi, Mi ... scale instead of the traditional k, G, M, ... prefixes

Returns
  the string representing the number in metric system (ex: "1 ko", "200 Mio", ...)

## ◆ tools_do_some_files_match_mask_regex()

bool libdar::tools_do_some_files_match_mask_regex | ( | const entrepot & | ent,
|  | const std::string & | file_mask
| ) |  |

test the presence of files corresponding to a given mask in a directory (regex mask)

Parameters

  [in] | ent | entrepot where to read filesystem from
  [in] | file_mask | regex expression which designates the files to look for

Returns
  true if some files have found matching the file_mask

## ◆ tools_file_size_to_crc_size()

infinint libdar::tools_file_size_to_crc_size | ( | const infinint & | size | ) |

Defines the CRC size to use for a given filesize.

Parameters

  [in] | size | is the size of the file to protect by CRC

Returns
  crc_size is the size of the crc to use

## ◆ tools_find_last_char_of()

std::string::iterator libdar::tools_find_last_char_of | ( | std::string & | s,
|  | unsigned char | v
| ) |  |

give a pointer to the last character of the given value in the given string

Parameters

  [in] | s | is the given string
  [in] | v | is the given char value

Returns
  a interator on s, pointing on the last char of s equal to v or a pointing to s.end() if no such char could be found is "s"

Note
  the arguments are not modified neither the data they are pointing to. However the const statement has not been used to be able to return a iterator on the string (and not a const_interator). There is probably other ways to do that (using const_cast) for example

## ◆ tools_get_extended_size()

infinint libdar::tools_get_extended_size | ( | std::string | s,
|  | U_I | base
| ) |  |

convert the given string to infinint taking care of multiplication suffixes like k, M, T, etc.

Parameters

  [in] | s | is the string to read
  [in] | base | is the multiplication factor (base = 1000 for SI, base = 1024 for computer science use)

Returns
  the value encoded in the given string

## ◆ tools_get_filesize()

infinint libdar::tools_get_filesize | ( | const path & | p | ) |

retrieve the size in byte of a file

Parameters

  [in] | p | is the path to the file which size is to get

Returns
  the size of the file in byte

## ◆ tools_get_mtime()

datetime libdar::tools_get_mtime | ( | user_interaction & | dialog,
|  | const std::string & | s,
|  | bool | auto_zeroing,
|  | bool | silent,
|  | const std::set< std::string > & | ignored_as_symlink = `std::set< std::string >()`
| ) |  |

returns the last modification date of the given file

Parameters

  [in,out] | dialog | for user interaction
  [in] | s | path of the file to get the last mtime
  [in] | auto_zeroing | whether to just warn instead of asking user confirmation
  [in] | silent | if set do not warn nor ask
  [in] | ignored_as_symlink | for inodes present in this set, get the symlink pointed to date rather than the date of they symlink itself (no impact if the inode is not a symlink)

Returns
  the mtime of the given file

## ◆ tools_get_permission()

U_I libdar::tools_get_permission | ( | S_I | fd | ) |

obtain the permission of the file which descriptor is given

Parameters

  [in] | fd | file's descriptor

Returns
  permission of the given file

Note
  in case of error exception may be thrown

## ◆ tools_get_size()

infinint libdar::tools_get_size | ( | const std::string & | s | ) |

returns the size of the given plain file

Parameters

  [in] | s | path of the file to get the size

Returns
  the size if the file in byte

## ◆ tools_hook_execute()

void libdar::tools_hook_execute | ( | user_interaction & | ui,
|  | const std::string & | cmd_line
| ) |  |

execute and retries at user will a given command line

Parameters

  [in] | ui | which way to ask the user whether to continue upon command line error
  [in] | cmd_line | the command line to execute

## ◆ tools_hook_substitute()

std::string libdar::tools_hook_substitute | ( | const std::string & | hook,
|  | const std::string & | path,
|  | const std::string & | basename,
|  | const std::string & | num,
|  | const std::string & | padded_num,
|  | const std::string & | ext,
|  | const std::string & | context,
|  | const std::string & | base_url
| ) |  |

produces the string resulting from the substitution of %... macro

Parameters

  [in] | hook | the string in which to substitute
  [in] | path | is by what p will be replaced
  [in] | basename | is by what b will be replaced
  [in] | num | is by what n will be replaced
  [in] | padded_num | is by what N will be replaced
  [in] | ext | is by what e will be replaced
  [in] | context | is by what c will be replaced
  [in] | base_url | remote repository base URL

Returns
  the substitued resulting string

Note
  it now relies on tools_substitue

## ◆ tools_hook_substitute_and_execute()

void libdar::tools_hook_substitute_and_execute | ( | user_interaction & | ui,
|  | const std::string & | hook,
|  | const std::string & | path,
|  | const std::string & | basename,
|  | const std::string & | num,
|  | const std::string & | padded_num,
|  | const std::string & | ext,
|  | const std::string & | context,
|  | const std::string & | base_url
| ) |  |

subsititue and execute command line

Parameters

  [in,out] | ui | this is the way to contact the user
  [in] | hook | the string in which to substitute
  [in] | path | is by what p will be replaced
  [in] | basename | is by what b will be replaced
  [in] | num | is by what n will be replaced
  [in] | padded_num | is by what N will be replaced
  [in] | ext | is by what e will be replaced
  [in] | context | is by what c will be replaced
  [in] | base_url | remote repository base URL

## ◆ tools_infinint2U_64()

bool libdar::tools_infinint2U_64 | ( | infinint | val,
|  | U_64 & | res
| ) |  |

convert an infinint to U_64 (aka "uint64_t" or yet "unsigned long long")

Note
  : if the infinint is too large to fit in an U_64 it returns false

## ◆ tools_int2octal()

std::string libdar::tools_int2octal | ( | const U_I & | perm | ) |

convert a number to a string corresponding to its octal representation

Parameters

  perm | is the octal number

Returns
  the corresponding octal string

## ◆ tools_int2str()

std::string libdar::tools_int2str | ( | S_I | x | ) |

convert integer to string

Parameters

  [in] | x | the integer to convert

Returns
  the decimal representation of the given integer

## ◆ tools_is_case_insensitive_equal()

bool libdar::tools_is_case_insensitive_equal | ( | const std::string & | a,
|  | const std::string & | b
| ) |  |

compare two string in case insensitive manner

Parameters

  [in] | a | first string to compare
  [in] | b | second string to compare

Returns
  whether the two string given in argument are equal in case insensitive comparison

## ◆ tools_is_equal_with_hourshift()

bool libdar::tools_is_equal_with_hourshift | ( | const infinint & | hourshift,
|  | const datetime & | date1,
|  | const datetime & | date2
| ) |  |

test if two dates are equal taking care of a integer hour of difference

Parameters

  [in] | hourshift | is the number of integer hour more or less two date can be considered equal
  [in] | date1 | first date to compare
  [in] | date2 | second date to compare to

Returns
  whether dates are equal or not

## ◆ tools_make_date()

void libdar::tools_make_date | ( | const std::string & | chemin,
|  | bool | symlink,
|  | const datetime & | access,
|  | const datetime & | modif,
|  | const datetime & | birth
| ) |  |

set dates of a given file, may throw exception

Parameters

  [in] | chemin | the path to the file to set
  [in] | symlink | true if the file is a symlink
  [in] | access | last access date to use
  [in] | modif | last modification date to use
  [in] | birth | time of creation of the file

Note
  if birth time is not known, it should be set to the value of modif for efficiency

## ◆ tools_memxor()

void libdar::tools_memxor | ( | void * | dest,
|  | const void * | src,
|  | U_I | n
| ) |  |

Produces in "dest" the XORed value of "dest" and "src".

Parameters

  [in,out] | dest | is the area where to write down the result
  [in] | src | points to vector or array of values to convert
  [in] | n | is the number of byte to convert from src to dest

Note
  dest must be a valid pointer to an allocated memory area of at least n bytes

## ◆ tools_my_atoi()

bool libdar::tools_my_atoi | ( | const char * | a,
|  | U_I & | val
| ) |  |

ascii to integer conversion

Parameters

  [in] | a | is the ascii string to convert
  [out] | val | is the resulting value

Returns
  true if the conversion could be done false if the given string does not correspond to the decimal representation of an unsigned integer

Note
  this call is now a warapper around line_tools_str2int

## ◆ tools_name_of_gid()

std::string libdar::tools_name_of_gid | ( | const infinint & | gid | ) |

convert gid to name in regards of the current system's configuration

Parameters

  [in] | gid | the Group ID number

Returns
  the name of the corresponding group or the gid if none corresponds

## ◆ tools_name_of_uid()

std::string libdar::tools_name_of_uid | ( | const infinint & | uid | ) |

convert uid to name in regards to the current system's configuration

Parameters

  [in] | uid | the User ID number

Returns
  the name of the corresponding user or the uid if none corresponds

## ◆ tools_noexcept_make_date()

void libdar::tools_noexcept_make_date | ( | const std::string & | chem,
|  | bool | symlink,
|  | const datetime & | last_acc,
|  | const datetime & | last_mod,
|  | const datetime & | birth
| ) |  |

set dates of a given file, no exception thrown

Parameters

  [in] | chem | the path to the file to set
  [in] | symlink | true if the file is a symlink
  [in] | last_acc | last access date to use
  [in] | last_mod | last modification date to use
  [in] | birth | creation date of the file, if not known, use the value of last_mod for efficiency

## ◆ tools_number_base_decomposition_in_big_endian()

template<class N , class B >

std::deque<B> libdar::tools_number_base_decomposition_in_big_endian | ( | N | number,
|  | const B & | base
| ) |  |

Template for the decomposition of any number in any base (decimal, octal, hexa, etc.)

Parameters

  [in] | number | is the number to decompose
  [in] | base | is the base to decompose the number into

Returns
  a vector of 'digit' int the specified base, the first beeing the less significative

Note
  this template does not take care of the possibily existing optimized euclide division to speed up the operation like what exists for infinint. A specific overriden fonction for this type would be better.
  , the name "big_endian" is erroneous, it gives a little endian vector

Definition at line 577 of file tools.hpp.

## ◆ tools_octal2int()

U_I libdar::tools_octal2int | ( | const std::string & | perm | ) |

convert octal string to integer

Parameters

  perm | is a string representing a number in octal (string must have a leading zero)

Returns
  the corresponding value as an integer

## ◆ tools_output2xml()

std::string libdar::tools_output2xml | ( | const std::string & | src | ) |

convert string for xml output

Note
  any < > & quote and double quote are replaced by adequate sequence for unicode
  second point, nothing is done here to replace system native strings to unicode

## ◆ tools_ownership2gid()

uid_t libdar::tools_ownership2gid | ( | const std::string & | group | ) |

convert string group name or gid to numeric gid value

Parameters

  [in] | group | string username

Returns
  uid value

## ◆ tools_ownership2uid()

uid_t libdar::tools_ownership2uid | ( | const std::string & | user | ) |

change ownership of the file which descriptor is given

convert string user name or uid to numeric uid value

Parameters

  [in] | user | string username

Returns
  uid value

## ◆ tools_printf()

std::string libdar::tools_printf | ( | const char * | format,
|  |  | ...
| ) |  |

make printf-like formating to a std::string

Parameters

  [in] | format | the format string
  [in] | ... | list of argument to use against the format string

Returns
  the resulting string

Note
  the supported masks for the format are:
  - %s %c %d %o %% (usual behavior)
  - %x display an integer under hexadecimal notation
  - %i (matches infinint *)
  - %S (matches std::string *)

Referenced by line_tools_split_in_words(), and libdar::tools_check_negative_date().

## ◆ tools_pseudo_random()

U_I libdar::tools_pseudo_random | ( | U_I | max | ) |

Produces a pseudo random number x, where 0 <= x < max.

Parameters

  [in] | max | defines the range of the random number to return

Returns
  the returned value ranges from 0 (zero) up to max (= including max)

## ◆ tools_read_string()

void libdar::tools_read_string | ( | generic_file & | f,
|  | std::string & | s
| ) |  |

read a string from a file expecting it to terminate by '\0'

Parameters

  f | the file to read from
  s | the string to put the data to (except the ending '\0')

## ◆ tools_read_string_size()

void libdar::tools_read_string_size | ( | generic_file & | f,
|  | std::string & | s,
|  | infinint | taille
| ) |  |

read a string if given size from a file '\0' has no special meaning

Parameters

  [in] | f | is the file to read from
  [in] | s | is the string to put read data in
  [in] | taille | is the size in byte to read

## ◆ tools_read_vector()

void libdar::tools_read_vector | ( | generic_file & | f,
|  | std::vector< std::string > & | x
| ) |  |

read a list of string from a file

Parameters

  [in] | f | the file to read from
  [out] | x | the list to fill from file

## ◆ tools_readlink()

std::string libdar::tools_readlink | ( | const char * | root | ) |

returns the file pointed to by a symbolic link (or transparent if the file is not a symlink).

Parameters

  root | the path to the file to read

Returns
  the file pointed to by the symlink or the value given in argument if it is not a symlink

Note
  an exception can occur if lack of memory or invalid argument given (nullptr or empty string), system call error...

## ◆ tools_relative2absolute_path()

path libdar::tools_relative2absolute_path | ( | const path & | src,
|  | const path & | cwd
| ) |  |

transform a relative path to an absolute one given the current directory value

Parameters

  [in] | src | the relative path to transform
  [in] | cwd | the value to take for the current directory

Returns
  the corresponding absolute path

## ◆ tools_release_struct_dirent()

void libdar::tools_release_struct_dirent | ( | struct dirent * | ptr | ) |

release a dirent structure as allocated by tools_allocate_struct_dirent

Parameters

  [in] | ptr | is the address of the structure to release

## ◆ tools_set_back_blocked_signals()

void libdar::tools_set_back_blocked_signals | ( | sigset_t | old_mask | ) |

unblock signals according to given mask

Parameters

  [in] | old_mask | value to set to blocked signal mask

Exceptions

  Erange | is thrown if system call failed for some reason

## ◆ tools_set_ownership()

void libdar::tools_set_ownership | ( | S_I | filedesc,
|  | const std::string & | slice_user,
|  | const std::string & | slice_group
| ) |  |

change ownership of the file which descriptor is given

Parameters

  [in] | filedesc | file's descriptor
  [in] | slice_user | the user to set the file to. For empty string, no attempts to change the user ownership is done
  [in] | slice_group | the group to set the file to. For empty string, no attempts to change the group ownership is done

Note
  this call may throw Erange exception upon system error

## ◆ tools_set_permission()

void libdar::tools_set_permission | ( | S_I | fd,
|  | U_I | perm
| ) |  |

change the permission of the file which descriptor is given

Parameters

  [in] | fd | file's descriptor
  [in] | perm | file permission to set the file to

## ◆ tools_str2charptr()

char* libdar::tools_str2charptr | ( | const std::string & | x | ) |

convert a string to a char *

Parameters

  [in] | x | is the string to convert

Returns
  the address of newly allocated memory containing the equivalent string as the argument

Exceptions

  Ememory | is thrown if the memory allocation failed, this call never return nullptr

Note
  Do not use this function, use std::string::c_str(). The allocated memory must be released by the caller thanks to the "delete []" operator

## ◆ tools_str2int()

U_I libdar::tools_str2int | ( | const std::string & | x | ) |

convert an integer written in decimal notation to the corresponding value

Parameters

  [in] | x | the decimal representation of the integer

Returns
  the value corresponding to the decimal representation given

## ◆ tools_string2tlv_list()

tlv_list libdar::tools_string2tlv_list | ( | user_interaction & | dialog,
|  | const U_16 & | type,
|  | const std::vector< std::string > & | data
| ) |  |

Produces a list of TLV from a constant type and a list of string.

Parameters

  [in,out] | dialog | for user interaction
  [in] | type | is the type each TLV will have
  [in] | data | is the list of string to convert into a list of TLV

Returns
  a tlv_list object. Each TLV in the list correspond to a string in the given list

## ◆ tools_string_to_hexa()

std::string libdar::tools_string_to_hexa | ( | const std::string & | input | ) |

convert a string into its hexadecima representation

Parameters

  [in] | input | input string to convert

Returns
  a string containing an hexadecimal number corresponding to the bytes of the input string

## ◆ tools_substitute()

std::string libdar::tools_substitute | ( | const std::string & | hook,
|  | const std::map< char, std::string > & | corres
| ) |  |

produce the string resulting from the substition of % macro defined in the map

Parameters

  [in] | hook | is the user's expression in which to proceed to substitution
  [in] | corres | is a map telling which char following a % sign to replace by which string

Returns
  the resulting string of the substitution

## ◆ tools_system()

void libdar::tools_system | ( | user_interaction & | dialog,
|  | const std::vector< std::string > & | argvector
| ) |  |

wrapper to the "system" system call.

Parameters

  [in,out] | dialog | for user interaction
  [in] | argvector | the equivalent to the argv[] vector

## ◆ tools_system_with_pipe()

void libdar::tools_system_with_pipe | ( | const std::shared_ptr< user_interaction > & | dialog,
|  | const std::string & | dar_cmd,
|  | const std::vector< std::string > & | argvpipe
| ) |  |

wrapper to the "system" system call using anonymous pipe to tranmit arguments to the child process

Parameters

  [in,out] | dialog | for user interaction
  [in] | dar_cmd | the path to the executable to run
  [in] | argvpipe | the list of arguments to pass through anonymous pipe

Note
  the command to execute must understand the –pipe-fd option that gives the filedescriptor to read from the command-line options

## ◆ tools_to_upper()

void libdar::tools_to_upper | ( | const std::string & | r,
|  | std::string & | uppered
| ) |  |

convert a string to upper case

Parameters

  [in] | r | the string to convert
  [out] | uppered | resulting upper cased string

Note
  in case of invalid wide char met in source string, the upper case convertion is done in ASCII mode (byte by byte)

## ◆ tools_unlink_file_mask_regex()

void libdar::tools_unlink_file_mask_regex | ( | user_interaction & | dialog,
|  | const entrepot & | ent,
|  | const std::string & | file_mask,
|  | bool | info_details
| ) |  |

remove files from a given directory

Parameters

  [in,out] | dialog | for user interaction
  [in] | ent | entrepot where to remove files from
  [in] | file_mask | regex expression which designates the files to remove
  [in] | info_details | whether user must be displayed details of the operation

Note
  This is equivalent to the 'rm' command with regex expression in place of glob one

## ◆ tools_unsigned_char_to_hexa()

std::string libdar::tools_unsigned_char_to_hexa | ( | unsigned char | x | ) |

convert a unsigned char into its hexa decima representation

Parameters

  [in] | x | is the byte to convert

Returns
  the string representing the value of x written in hexadecimal

## ◆ tools_uword2str()

std::string libdar::tools_uword2str | ( | U_16 | x | ) |

convert unsigned word to string

Parameters

  [in] | x | the unsigned word to convert

Returns
  the decimal representation of the given integer

## ◆ tools_vprintf()

std::string libdar::tools_vprintf | ( | const char * | format,
|  | va_list | ap
| ) |  |

make printf-like formating to a std::string

Parameters

  [in] | format | the format string
  [in] | ap | list of argument to use against the format string

Returns
  the resulting string

Note
  the supported masks for the format are:
  - %s %c %d %% (normal behavior)
  - %i (matches infinint *)
  - %S (matches std::string *)

## ◆ tools_write_string()

void libdar::tools_write_string | ( | generic_file & | f,
|  | const std::string & | s
| ) |  |

write a string to a file with a '\0' at then end

Parameters

  [in] | f | the file to write to
  [in] | s | the string to write to file

## ◆ tools_write_string_all()

void libdar::tools_write_string_all | ( | generic_file & | f,
|  | const std::string & | s
| ) |  |

write a string to a file, '\0' has no special meaning nor is added at the end

Parameters

  [in] | f | the file to write to
  [in] | s | the string to write to file

## ◆ tools_write_vector()

void libdar::tools_write_vector | ( | generic_file & | f,
|  | const std::vector< std::string > & | x
| ) |  |

write a list of string to file

Parameters

  [in] | f | the file to write to
  [in] | x | the list of string to write