30 #include "../my_config.h"
70 #define LIBDAR_XXXXXXXX
73 #define LIBDAR_NOEXCEPT 0
75 #define LIBDAR_EMEMORY 1
79 #define LIBDAR_EINFININT 3
81 #define LIBDAR_ELIMITINT 4
83 #define LIBDAR_ERANGE 5
85 #define LIBDAR_EDECI 6
87 #define LIBDAR_EFEATURE 7
89 #define LIBDAR_EHARDWARE 8
91 #define LIBDAR_EUSER_ABORT 9
93 #define LIBDAR_EDATA 10
95 #define LIBDAR_ESCRIPT 11
97 #define LIBDAR_ELIBCALL 12
99 #define LIBDAR_UNKNOWN 13
101 #define LIBDAR_ECOMPILATION 14
103 #define LIBDAR_THREAD_CANCEL 15
159 constexpr
compression lzo1x_1_15 = compression::lzo1x_1_15;
160 constexpr
compression lzo1x_1 = compression::lzo1x_1;
169 constexpr
crypto_algo crypto_none = crypto_algo::none;
170 constexpr
crypto_algo crypto_scrambling = crypto_algo::scrambling;
171 constexpr
crypto_algo crypto_blowfish = crypto_algo::blowfish;
172 constexpr
crypto_algo crypto_aes256 = crypto_algo::aes256;
173 constexpr
crypto_algo crypto_twofish256 = crypto_algo::twofish256;
174 constexpr
crypto_algo crypto_serpent256 = crypto_algo::serpent256;
175 constexpr
crypto_algo crypto_camellia256 = crypto_algo::camellia256;
193 constexpr
capa_status capa_set = libdar::capa_status::capa_set;
194 constexpr
capa_status capa_clear = libdar::capa_status::capa_clear;
195 constexpr
capa_status capa_unknown = libdar::capa_status::capa_unknown;
241 using libdar::crit_or;
242 using libdar::crit_invert;
246 constexpr
over_action_data data_preserve = libdar::over_action_data::data_preserve;
247 constexpr
over_action_data data_overwrite = libdar::over_action_data::data_overwrite;
248 constexpr
over_action_data data_preserve_mark_already_saved = libdar::over_action_data::data_preserve_mark_already_saved;
249 constexpr
over_action_data data_overwrite_mark_already_saved = libdar::over_action_data::data_overwrite_mark_already_saved;
250 constexpr
over_action_data data_remove = libdar::over_action_data::data_remove;
251 constexpr
over_action_data data_undefined = libdar::over_action_data::data_undefined;
255 constexpr
over_action_ea EA_preserve = libdar::over_action_ea::EA_preserve;
256 constexpr
over_action_ea EA_overwrite = libdar::over_action_ea::EA_overwrite;
257 constexpr
over_action_ea EA_clear = libdar::over_action_ea::EA_clear;
258 constexpr
over_action_ea EA_preserve_mark_already_saved = libdar::over_action_ea::EA_preserve_mark_already_saved;
259 constexpr
over_action_ea EA_overwrite_mark_already_saved = libdar::over_action_ea::EA_overwrite_mark_already_saved;
260 constexpr
over_action_ea EA_merge_preserve = libdar::over_action_ea::EA_merge_preserve;
261 constexpr
over_action_ea EA_merge_overwrite = libdar::over_action_ea::EA_merge_overwrite;
262 constexpr
over_action_ea EA_undefined = libdar::over_action_ea::EA_undefined;
275 constexpr
hash_algo hash_none = hash_algo::none;
276 constexpr
hash_algo hash_md5 = hash_algo::md5;
277 constexpr
hash_algo hash_sha1 = hash_algo::sha1;
278 constexpr
hash_algo hash_sha512= hash_algo::sha512;
282 constexpr
fsa_family fsaf_hfs_plus = fsa_family::fsaf_hfs_plus;
283 constexpr
fsa_family fsaf_linux_extX = fsa_family::fsaf_linux_extX;
286 constexpr
fsa_nature fsan_unset = fsa_nature::fsan_unset;
287 constexpr
fsa_nature fsan_creation_date = fsa_nature::fsan_creation_date;
288 constexpr
fsa_nature fsan_append_only = fsa_nature::fsan_append_only;
289 constexpr
fsa_nature fsan_compressed = fsa_nature::fsan_compressed;
290 constexpr
fsa_nature fsan_no_dump = fsa_nature::fsan_no_dump;
291 constexpr
fsa_nature fsan_immutable = fsa_nature::fsan_immutable;
292 constexpr
fsa_nature fsan_data_journaling = fsa_nature::fsan_data_journaling;
293 constexpr
fsa_nature fsan_secure_deletion = fsa_nature::fsan_secure_deletion;
294 constexpr
fsa_nature fsan_no_tail_merging = fsa_nature::fsan_no_tail_merging;
295 constexpr
fsa_nature fsan_undeletable = fsa_nature::fsan_undeletable;
296 constexpr
fsa_nature fsan_noatime_update = fsa_nature::fsan_noatime_update;
297 constexpr
fsa_nature fsan_synchronous_directory = fsa_nature::fsan_synchronous_directory;
298 constexpr
fsa_nature fsan_synchronous_udpdate = fsa_nature::fsan_synchronous_update;
299 constexpr
fsa_nature fsan_top_of_dir_hierarchy = fsa_nature::fsan_top_of_dir_hierarchy;
307 constexpr
gf_mode gf_read_only = gf_mode::gf_read_only;
308 constexpr
gf_mode gf_write_only = gf_mode::gf_write_only;
309 constexpr
gf_mode gf_read_write = gf_mode::gf_read_write;
319 namespace compile_time
386 extern void get_version(U_I & major, U_I & medium, U_I & minor,
bool init_libgcrypt =
true);
401 extern void get_version_noexcept(U_I & major, U_I & medium, U_I & minor, U_16 & exception, std::string & except_msg,
bool init_libgcrypt =
true);
417 extern void close_and_clean();
435 const path & chem,
const std::string & basename,
436 const std::string & extension,
437 const archive_options_read & options,
439 std::string & except_msg);
448 const path & fs_root,
449 const path & sauv_path,
450 const std::string & filename,
451 const std::string & extension,
452 const archive_options_create & options,
455 std::string & except_msg);
466 const path &sauv_path,
467 const std::string & filename,
468 const std::string & extension,
469 const archive_options_isolate & options,
471 std::string & except_msg);
479 const path & sauv_path,
481 const std::string & filename,
482 const std::string & extension,
483 const archive_options_merge & options,
486 std::string & except_msg);
496 std::string & except_msg);
510 std::string & except_msg);
520 const archive_options_listing & options,
522 std::string & except_msg);
532 const path & fs_root,
533 const archive_options_diff & options,
536 std::string & except_msg);
549 std::string & except_msg);
559 const std::string & dir,
561 std::string & except_msg);
595 extern void cancel_thread(pthread_t tid,
bool immediate =
true, U_64 flag = 0);
601 extern bool cancel_status(pthread_t tid);
608 extern bool cancel_clear(pthread_t tid);
API v5 backward compatible class archive.
set of datastructures used to interact with a catalogue object
provide information about current thread (underlying using the widthdrawn POSIX.1e API)
the archive class realizes the most general operations on archives
This is a pure virtual class that is used by libdar when interaction with the user is required.
exception used to signal a bug. A bug is triggered when reaching some code that should never be reach...
exception used when a requested fearture has not beed activated at compilation time
exception used when an error concerning the treated data has been met
exception used to signal convertion problem between infinint and string (decimal representation)
exception used when a requested feature is not (yet) implemented
this is the parent class of all exception classes.
exception used when hardware problem is found
exception used when arithmetic error is detected when operating on infinint
exception used to signal an error in the argument given to libdar call of the API
exception used when a limitint overflow is detected, the maximum value of the limitint has been excee...
exception used when memory has been exhausted
exception used to signal range error
exception used when error the inter-slice user command returned an error code
exception used when secure memory has been exhausted
exception used to carry system error
exception used when the thread libdar is running in is asked to stop
exception used to signal that the user has aborted the operation
class archive_num stores the position of an archive inside a dar_manager database
class holding optional parameters used to test the structure coherence of an existing archive
boolean mask, either always true or false
the global action for overwriting
realises the AND operator
the crit_chain class sequences crit_actions up to full definition of the action
the basic constant action
returns true if the space used by EA of the first entry is greater or equal to the space used by the ...
returns true if the EA of the first entry is more recent or equal to the fixed date given in argument...
returns true if the EA of the first entry is more recent or equal to the one of the second entry
returns true if the in place entry has its EA saved (not just marked as saved) in the archve of refer...
returns true if the data of the first entry is bigger or equal to the one of the second entry
return true if the entry is a dirty file (or hard linked dirty file)
If the in_place entry is not an inode its date is considered equal to zero. Comparison is done on mti...
returns true if the data of the first entry is more recent or of the same date of the one of the seco...
if the entry is not an inode the result is also true
return true if the entry is a sparse file (or hard linked sparse file)
return true if the entry has delta signature
returns true if the first entry is a cat_directory (whatever is the second)
returns true if the first entry is a plain file (whatever is the second)
returns true if the first entry is a inode with several hard links (whatever is the second entry)
returns true if the first entry is an inode (whatever is the second)
returns true if the first entry has more or even EA (in number not in size) than the second entry
realises the negation of the criterium given in argument to its constructor
returns true if the two entries are of the same type (plain-file/char dev/block dev/named pipe/symlin...
the generic criterium class, parent of all criterium
decimal class, convert infinint from and to decimal represention
makes an AND operator between two or more masks
matches if string is the given constructor string or a sub directory of it
this is the interface class from which all other data transfer classes inherit
the arbitrary large positive integer class
the mask_list class, matches string that are present in a given file
the generic class, parent of all masks
generic_file stored in memory
makes the OR operator between two or more masks
the class path is here to manipulate paths in the Unix notation: using'/'
matches regular expressions (see "man 7 regex")
matches if string is exactly the given mask (no wilde card expression)
matches as done on shell command lines (see "man 7 glob")
string matches if it is subdir of mask or mask is a subdir of expression
class used by libdar::archive class to give a summary of treated file during and after an operation
the testing class binds criterium to actions
class to be used as parent to provide checkpoints to inherited classes
pipe implementation under the generic_file interface.
nested namespace containing routines that give features activated at compile time
compression engine implementation
the crypto algoritm definition
base classes used to store entree information in dar_manager databases
this file holds the database class definition as defined in API version 5
manages the decimal representation of infinint
defines the implementation for remote filesystem entrepot using libcurl
defines the implementation for local filesystem entrepot The entrepot_local correspond to the local f...
class fichier_local definition. This is a full implementation/inherited class of class fichier_global...
void get_version_noexcept(U_I &major, U_I &medium, U_I &minor, U_16 &exception, std::string &except_msg, bool init_libgcrypt=true)
return the libdar version, and make libdar initialization (does not throw exceptions)
const U_I LIBDAR_COMPILE_TIME_MINOR
libdar Minor version defined at compilation time
archive * merge_archive_noexcept(user_interaction &dialog, const path &sauv_path, archive *ref_arch1, const std::string &filename, const std::string &extension, const archive_options_merge &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "merging" constructor
archive * isolate_archive_noexcept(user_interaction &dialog, archive *ptr, const path &sauv_path, const std::string &filename, const std::string &extension, const archive_options_isolate &options, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "isolate" constructor
archive * create_archive_noexcept(user_interaction &dialog, const path &fs_root, const path &sauv_path, const std::string &filename, const std::string &extension, const archive_options_create &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "create" constructor
bool get_children_of_noexcept(user_interaction &dialog, archive *ptr, const std::string &dir, U_16 &exception, std::string &except_msg)
this is wrapper around the get_children_of method
archive * open_archive_noexcept(user_interaction &dialog, const path &chem, const std::string &basename, const std::string &extension, const archive_options_read &options, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "read" constructor
statistics op_extract_noexcept(user_interaction &dialog, archive *ptr, const path &fs_root, const archive_options_extract &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is wrapper around the op_extract method
void op_listing_noexcept(user_interaction &dialog, archive *ptr, const archive_options_listing &options, U_16 &exception, std::string &except_msg)
this is wrapper around the op_listing method
statistics op_diff_noexcept(user_interaction &dialog, archive *ptr, const path &fs_root, const archive_options_diff &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is wrapper around the op_diff method
const U_I LIBDAR_COMPILE_TIME_MAJOR
libdar Major version defined at compilation time
const U_I LIBDAR_COMPILE_TIME_MEDIUM
libdar Medium version defined at compilation time
statistics op_test_noexcept(user_interaction &dialog, archive *ptr, const archive_options_test &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is wrapper around the op_test method
void close_archive_noexcept(archive *ptr, U_16 &exception, std::string &except_msg)
this is wrapper around the archive destructor
char * libdar_str2charptr_noexcept(const std::string &x, U_16 &exception, std::string &except_msg)
routine provided to convert std::string to char *
void get_version(U_I &major, U_I &medium, U_I &minor, bool init_libgcrypt=true)
return the libdar version, and make libdar initialization (may throw Exceptions)
modified_data_detection
how to detect data has changed when some fields
comparison_fields
how to consider file change during comparison and incremental backup
std::string compression2string(compression c)
convert a compression to its string representation
over_action_ea
the possible action for overwriting EA
char compression2char(compression c, bool per_block=false)
convert a compression value to a char for storing in archive
fsa_scope all_fsa_families()
provides a scope containing all FSA families
std::set< fsa_family > fsa_scope
set of fsa families
compression char2compression(char a)
convert a char as stored in archive to its compression value
mycurl_protocol
libcurl protocols supported by libdar
hash_algo
hashing algorithm available
compression string2compression(const std::string &a)
convert a string representing a compression algorithm to its enum compression value
compression
the different compression algorithm available
crypto_algo
the different cypher available for encryption (strong or weak)
mycurl_protocol string_to_mycurl_protocol(const std::string &arg)
extract mycurl_protocol from a given URL
over_action_data
the possible actions for overwriting data
capa_status
the EFFECTIVE set the value of the associated capability for the calling thread
infinint tools_get_extended_size(std::string s, U_I base)
convert the given string to infinint taking care of multiplication suffixes like k,...
std::string tools_getcwd()
get current working directory
U_I tools_octal2int(const std::string &perm)
convert octal string to integer
std::string tools_printf(const char *format,...)
make printf-like formating to a std::string
gf_mode
generic_file openning modes
bool tools_my_atoi(const char *a, U_I &val)
ascii to integer conversion
switch module to limitint (32 ou 64 bits integers) or infinint
are defined here basic integer types that tend to be portable
here lies a collection of mask classes
here lies a mask that selects files present in a given list
libdar5 namespace encapsulate all libdar symbols
nested namespace inside libdar
here is the definition of the path class
class handling access to the data summary of treated files after and during each operation
holds the statistics contents of a catalogue
to be able to cancel libdar operation while running in a given thread.
defines the implementation of pipe under the generic_file interface.
defines the interaction interface between libdar and users.
API v5 backward compatible user_interaction_callback class.