/usr/include/dar/libdar_4_4.hpp is in libdar-dev 2.4.15-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | //*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2052 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// to contact the author : http://dar.linux.free.fr/email.html
/*********************************************************************/
/// \file libdar_4_4.hpp
/// \brief this file provide an alternative namespace to libdar for OLD API
/// \ingroup OLD_API_4_4
///
/// This is the OLD, deprecated but backward compatible APlication Interfaces (API 4.4.x found in release 2.3.x (with x >= 5) )
/// If you want to compile a program using an old libdar API against a recent libdar library
/// you have to include this file in place of libdar.hpp and change the
/// "namespace libdar" by the "namespace libdar_4_4", then link normally with
/// libdar library.
#ifndef LIBDAR_4_4_HPP
#define LIBDAR_4_4_HPP
#include "/usr/include/dar/libdar_my_config.h"
extern "C"
{
#if LIBDAR_MUTEX_WORKS
#if LIBDAR_HAS_PTHREAD_H
#include <pthread.h>
#endif
#endif
}
#include <string>
#include "/usr/include/dar/erreurs.hpp"
/// libdar_4_4 namespace encapsulate all symbols of the backward compatible API
namespace libdar_4_4
{
/// \addtogroup OLD_API_4_4
/// @{
typedef libdar::Egeneric Egeneric;
typedef libdar::Ememory Ememory;
typedef libdar::Ebug Ebug;
typedef libdar::Einfinint Einfinint;
typedef libdar::Elimitint Elimitint;
typedef libdar::Erange Erange;
typedef libdar::Edeci Edeci;
typedef libdar::Efeature Efeature;
typedef libdar::Ehardware Ehardware;
typedef libdar::Euser_abort Euser_abort;
typedef libdar::Edata Edata;
typedef libdar::Escript Escript;
typedef libdar::Elibcall Elibcall;
typedef libdar::Ecompilation Ecompilation;
typedef libdar::Ethread_cancel Ethread_cancel;
}
#include "/usr/include/dar/compressor.hpp"
namespace libdar_4_4
{
typedef libdar::compression compression;
const compression none = libdar::none;
const compression zip = libdar::gzip;
const compression gzip = libdar::gzip;
const compression bzip2 = libdar::bzip2;
inline compression char2compression(char a) { return libdar::char2compression(a); }
inline char compression2char(compression c) { return libdar::compression2char(c); }
inline std::string compression2string(compression c) { return libdar::compression2string(c); }
inline compression string2compression(const std::string & a) { return libdar::string2compression(a); }
typedef libdar::compressor compressor;
}
#include "/usr/include/dar/path.hpp"
namespace libdar_4_4
{
typedef libdar::path path;
}
#include "/usr/include/dar/mask.hpp"
namespace libdar_4_4
{
typedef libdar::mask mask;
typedef libdar::bool_mask bool_mask;
typedef libdar::simple_mask simple_mask;
typedef libdar::bool_mask bool_mask;
typedef libdar::regular_mask regular_mask;
typedef libdar::not_mask not_mask;
typedef libdar::et_mask et_mask;
typedef libdar::ou_mask ou_mask;
typedef libdar::simple_path_mask simple_path_mask;
typedef libdar::same_path_mask same_path_mask;
typedef libdar::exclude_dir_mask exclude_dir_mask;
}
#include "/usr/include/dar/integers.hpp" // OK
namespace libdar_4_4
{
typedef libdar::U_8 U_8;
typedef libdar::U_16 U_16;
typedef libdar::U_32 U_32;
typedef libdar::U_64 U_64;
typedef libdar::U_I U_I;
typedef libdar::S_8 S_8;
typedef libdar::S_16 S_16;
typedef libdar::S_32 S_32;
typedef libdar::S_64 S_64;
typedef libdar::S_I S_I;
}
#include "/usr/include/dar/infinint.hpp"
namespace libdar_4_4
{
typedef libdar::infinint infinint;
}
#include "/usr/include/dar/statistics.hpp"
namespace libdar_4_4
{
typedef libdar::statistics statistics;
}
#include "/usr/include/dar/user_interaction.hpp" // OK
namespace libdar_4_4
{
/// wrapper class for user_interaction
class user_interaction : public libdar::user_interaction
{
public:
virtual void dar_manager_show_version(U_I number,
const std::string & data_date,
const std::string & ea_date);
protected:
libdar::secu_string get_secu_string(const std::string & message, bool echo)
{
// this is a backward compatibile API, yes, we loose the secured storage feature for keys
std::string tmp = get_string(message, echo);
libdar::secu_string ret = libdar::secu_string(tmp.c_str(), tmp.size());
return ret;
};
private:
void dar_manager_show_version(U_I number,
const std::string & data_date,
const std::string & data_presence,
const std::string & ea_date,
const std::string & ea_presence)
{
dar_manager_show_version(number, data_date, ea_date);
}
};
typedef libdar::user_interaction_callback user_interaction_callback;
}
#include "/usr/include/dar/deci.hpp"
namespace libdar_4_4
{
typedef libdar::deci deci;
}
#include "/usr/include/dar/archive_version.hpp"
namespace libdar_4_4
{
typedef libdar::archive_version dar_version;
}
#include "/usr/include/dar/crypto.hpp"
namespace libdar_4_4
{
typedef libdar::crypto_algo crypto_algo;
const crypto_algo crypto_none = libdar::crypto_none;
const crypto_algo crypto_scrambling = libdar::crypto_scrambling;
const crypto_algo crypto_blowfish = libdar::crypto_blowfish;
const crypto_algo crypto_blowfish_weak = libdar::crypto_blowfish;
libdar::secu_string string2secu_string(const std::string & st);
inline void crypto_split_algo_pass(const std::string & all, crypto_algo & algo, std::string & pass)
{
libdar::secu_string sall = string2secu_string(all);
libdar::secu_string spass;
libdar::crypto_split_algo_pass(sall, algo, spass);
pass = spass.c_str();
}
/// wrapper class for blowfish
class blowfish : public libdar::crypto_sym
{
blowfish(user_interaction & dialog,
U_32 block_size,
const std::string & password,
generic_file & encrypted_side,
const dar_version & reading_ver,
bool weak_mode)
: libdar::crypto_sym(block_size, string2secu_string(password), encrypted_side, false, reading_ver, libdar::crypto_blowfish) {};
};
}
#include "/usr/include/dar/catalogue.hpp"
namespace libdar_4_4
{
typedef libdar::inode inode;
}
#include "/usr/include/dar/archive.hpp"
namespace libdar_4_4
{
/// wrapper class for archive
class archive : public libdar::archive
{
public:
/// convertion from libdar::archive * to libdar_4_4::archive *
/// \note this is possible because the libdar_4_4::archive class
/// does not own any additional field compared to libdar::archive
/// \note this piggy convertion is used in several places but it
/// implemented only in this method.
/// \note The correct implementation would have to create a libdar_4_4::archive
/// constructor having libdar::archive as argument, and relying on the
/// copy constructor of libdar::archive to create the new object. However
/// this copy constructor in libdar::archive does not exist for some
/// good reasons, and this solution would have been perfectly inefficient
static archive *piggy_convert(libdar::archive * ref);
/// defines the way archive listing is done:
typedef libdar::archive_options_listing::listformat listformat;
static const listformat normal = libdar::archive_options_listing::normal;
static const listformat tree = libdar::archive_options_listing::tree;
static const listformat xml = libdar::archive_options_listing::xml;
archive(user_interaction & dialog,
const path & chem,
const std::string & basename,
const std::string & extension,
crypto_algo crypto,
const std::string &pass,
U_32 crypto_size,
const std::string & input_pipe,
const std::string & output_pipe,
const std::string & execute,
bool info_details); // read constructor
archive(user_interaction & dialog,
const path & fs_root,
const path & sauv_path,
archive *ref_arch,
const mask & selection,
const mask & subtree,
const std::string & filename,
const std::string & extension,
bool allow_over,
bool warn_over,
bool info_details,
const infinint & pause,
bool empty_dir,
compression algo,
U_I compression_level,
const infinint &file_size,
const infinint &first_file_size,
const mask & ea_mask,
const std::string & execute,
crypto_algo crypto,
const std::string & pass,
U_32 crypto_size,
const mask & compr_mask,
const infinint & min_compr_size,
bool nodump,
inode::comparison_fields what_to_check,
const infinint & hourshift,
bool empty,
bool alter_atime,
bool same_fs,
bool snapshot,
bool cache_directory_tagging,
bool display_skipped,
const infinint & fixed_date,
statistics * progressive_report); // create constructor
archive(user_interaction & dialog,
const path &sauv_path,
archive *ref_arch,
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 std::string & pass,
U_32 crypto_size,
bool empty); // isolate constructor
archive(user_interaction & dialog,
const path & sauv_path,
archive *ref_arch1,
archive *ref_arch2,
const mask & selection,
const mask & subtree,
const std::string & filename,
const std::string & extension,
bool allow_over,
bool warn_over,
bool info_details,
const infinint & pause,
bool empty_dir,
compression algo,
U_I compression_level,
const infinint & file_size,
const infinint & first_file_size,
const mask & ea_mask,
const std::string & execute,
crypto_algo crypto,
const std::string & pass,
U_32 crypto_size,
const mask & compr_mask,
const infinint & min_compr_size,
bool empty,
bool display_skipped,
bool keep_compressed,
statistics * progressive_report); // merging constructor
statistics op_extract(user_interaction & dialog,
const path &fs_root,
const mask &selection,
const mask &subtree,
bool allow_over,
bool warn_over,
bool info_details,
bool detruire,
bool only_more_recent,
const mask & ea_mask,
bool flat,
inode::comparison_fields what_to_check,
bool warn_remove_no_match,
const infinint & hourshift,
bool empty,
bool ea_erase,
bool display_skipped,
statistics *progressive_report);
void op_listing(user_interaction & dialog,
bool info_details,
archive::listformat list_mode,
const mask &selection,
bool filter_unsaved);
statistics op_diff(user_interaction & dialog,
const path & fs_root,
const mask &selection,
const mask &subtree,
bool info_details,
const mask & ea_mask,
inode::comparison_fields what_to_check,
bool alter_atime,
bool display_skipped,
statistics * progressive_report,
const infinint & hourshift = 0);
statistics op_test(user_interaction & dialog,
const mask &selection,
const mask &subtree,
bool info_details,
bool display_skipped,
statistics * progressive_report);
};
}
#include "/usr/include/dar/thread_cancellation.hpp"
namespace libdar_4_4
{
typedef libdar::thread_cancellation thread_cancellation;
}
/// The following macro are used in the "exception" argument of the *_noexcept() functions
#define LIBDAR_XXXXXXXX
/// normal return no exception has been thrown
#define LIBDAR_NOEXCEPT 0
/// memory has been exhausted
#define LIBDAR_EMEMORY 1
/// internal bug error.
#define LIBDAR_EBUG 2
/// division by zero or other arithmetic error
#define LIBDAR_EINFININT 3
/// limitint overflow
#define LIBDAR_ELIMITINT 4
/// range error
#define LIBDAR_ERANGE 5
/// decimal representation error
#define LIBDAR_EDECI 6
/// feature not (yet) implemented
#define LIBDAR_EFEATURE 7
/// hardware failure
#define LIBDAR_EHARDWARE 8
/// user has aborted the operation
#define LIBDAR_EUSER_ABORT 9
/// data inconsistency, error concerning the treated data
#define LIBDAR_EDATA 10
/// inter slice script failure
#define LIBDAR_ESCRIPT 11
/// libdar invalid call (wrong argument given to call, etc.)
#define LIBDAR_ELIBCALL 12
/// unknown error
#define LIBDAR_UNKNOWN 13
/// feature not activated at compilation time
#define LIBDAR_ECOMPILATION 14
/// thread cancellation has been requested
#define LIBDAR_THREAD_CANCEL 15
namespace libdar_4_4
{
/// libdar Major version defined at compilation time
const U_I LIBDAR_COMPILE_TIME_MAJOR = 4;
/// libdar Medium version defined at compilation time
// the last libdar version of releases 2.3.x is 4.5.0, so we skip by one the medium to make the difference,
// but we keep the major to 4 (to avoid alarming external programs expecting the libdar API version 4)
const U_I LIBDAR_COMPILE_TIME_MEDIUM = 6;
/// libdar Minor version defined at compilation time
const U_I LIBDAR_COMPILE_TIME_MINOR = 12;
////////////////////////////////////////////////////////////////////////
// LIBDAR INITIALIZATION METHODS //
// //
// A FUNCTION OF THE get_version*() FAMILY *MUST* BE CALLED //
// BEFORE ANY OTHER FUNCTION OF THIS LIBRARY //
// //
// CLIENT PROGRAM MUST CHECK THAT THE MAJOR NUMBER RETURNED //
// BY THIS CALL IS NOT GREATER THAN THE LIBDAR_VERSION USED AT COMPILATION //
// TIME. IF SO, THE PROGRAM MUST ABORT AND RETURN A WARNING TO THE //
// USER TELLING THE DYNAMICALLY LINKED LIBDAR_VERSION IS TOO RECENT AND NOT //
// COMPATIBLE WITH THIS SOFTWARE. THE MESSAGE MUST INVITE THE USER //
// TO UPGRADE HIS SOFTWARE WITH A MORE RECENT LIBDAR_VERSION COMPATIBLE WITH //
// THIS LIBDAR RELEASE. //
////////////////////////////////////////////////////////////////////////
/// depreacted old get_version function
void get_version(U_I & major, U_I & minor, bool init_libgcrypt = true);
/// depreacted old get_version function
void get_version_noexcept(U_I & major, U_I & minor, U_16 & exception, std::string & except_msg, bool init_libgcrypt = true);
/// return the libdar version, and make libdar initialization (may throw Exceptions)
/// It is mandatory to call this function (or another one of the get_version* family)
/// \param[out] major the major number of the version
/// \param[out] medium the medium number of the version
/// \param[out] minor the minor number of the version
/// \param[in] init_libgcrypt whether to initialize libgcrypt if not already done (not used if libcrypt is not linked with libdar)
/// \note the calling application must match that the major function
/// is the same as the libdar used at compilation time. See API tutorial for a
/// sample code.
void get_version(U_I & major, U_I & medium, U_I & minor, bool init_libgcrypt = true);
/// return the libdar version, and make libdar initialization (does not throw exceptions)
/// It is mandatory to call this function (or another one of the get_version* family)
/// \param[out] major the major number of the version
/// \param[out] medium the medium number of the version
/// \param[out] minor the minor number of the version
/// \param[out] exception is to be compared with the LIBDAR_* macro to know whether the call succeeded
/// \param[out] except_msg in case exception is not equal to LIBDAR_NOEXCEPT this argument contains
/// \param[in] init_libgcrypt whether to initialize libgcrypt if not already done (not used if libcrypt is not linked with libdar)
/// a human readable explaination of the error met.
/// \note the calling application must match that the major function
/// is the same as the libdar used at compilation time. See API tutorial for a
/// sample code.
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 options activated that have been activated at compilation time
/// \param[out] ea whether Extended Attribute support is available
/// \param[out] largefile whether large file support is available
/// \param[out] nodump whether the nodump feature is available
/// \param[out] special_alloc whether special allocation is activated
/// \param[out] bits the internal integer type used
/// \param[out] thread_safe whether thread safe support is available
/// \param[out] libz whether gzip compression is available
/// \param[out] libbz2 whether bz2 compression is available
/// \param[out] libcrypto whether strong encryption is available
/// \param[out] new_blowfish whether new blowfish implementation is available
/// \note This function does never throw exceptions, so there is no
/// get_compile_time_features_noexcept() function available.
void get_compile_time_features(bool & ea, bool & largefile, bool & nodump, bool & special_alloc, U_I & bits,
bool & thread_safe,
bool & libz, bool & libbz2, bool & libcrypto,
bool & new_blowfish);
//////////
// WRAPPER FUNCTIONS AROUND archive class methods to trap exceptions and convert them in error code and message
// these are intended for C program/programmers not enough confident with C++.
//
// FOR LIBDAR C++ APPLICATIONS, YOU WOULD RATHER USE THE archive C++ CLASS THAN THESE FOLLOWING WRAPPERS
//
//////////
/// this is a wrapper around the archive constructor known as the "read" constructor
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
archive* open_archive_noexcept(user_interaction & dialog,
const path & chem, const std::string & basename,
const std::string & extension,
crypto_algo crypto, const std::string &pass, U_32 crypto_size,
const std::string & input_pipe, const std::string & output_pipe,
const std::string & execute, bool info_details,
U_16 & exception,
std::string & except_msg);
/// this is a wrapper around the archive constructor known as the "create" constructor
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern archive *create_archive_noexcept(user_interaction & dialog,
const path & fs_root,
const path & sauv_path,
archive *ref_arch,
const mask & selection,
const mask & subtree,
const std::string & filename,
const std::string & extension,
bool allow_over,
bool warn_over,
bool info_details,
const infinint & pause,
bool empty_dir,
compression algo,
U_I compression_level,
const infinint &file_size,
const infinint &first_file_size,
const mask & ea_mask,
const std::string & execute,
crypto_algo crypto,
const std::string & pass,
U_32 crypto_size,
const mask & compr_mask,
const infinint & min_compr_size,
bool nodump,
inode::comparison_fields what_to_check,
const infinint & hourshift,
bool empty,
bool alter_atime,
bool same_fs,
bool snapshot,
bool cache_directory_tagging,
bool display_skipped,
const infinint & fixed_date,
statistics * progressive_report,
U_16 & exception,
std::string & except_msg);
/// this is a wrapper around the archive constructor known as the "isolate" constructor
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern archive *isolate_archive_noexcept(user_interaction & dialog,
const path &sauv_path,
archive *ref_arch,
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 std::string & pass,
U_32 crypto_size,
bool empty,
U_16 & exception,
std::string & except_msg);
/// this is a wrapper around the archive constructor known as the "merging" constructor
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern archive *merge_archive_noexcept(user_interaction & dialog,
const path & sauv_path,
archive *ref_arch1,
archive *ref_arch2,
const mask & selection,
const mask & subtree,
const std::string & filename,
const std::string & extension,
bool allow_over,
bool warn_over,
bool info_details,
const infinint & pause,
bool empty_dir,
compression algo,
U_I compression_level,
const infinint & file_size,
const infinint & first_file_size,
const mask & ea_mask,
const std::string & execute,
crypto_algo crypto,
const std::string & pass,
U_32 crypto_size,
const mask & compr_mask,
const infinint & min_compr_size,
bool empty,
bool display_skipped,
bool keep_compressed,
statistics * progressive_report,
U_16 & exception,
std::string & except_msg);
/// this is wrapper around the archive destructor
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern void close_archive_noexcept(archive *ptr,
U_16 & exception,
std::string & except_msg);
/// this is wrapper around the op_extract method
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern statistics op_extract_noexcept(user_interaction & dialog,
archive *ptr,
const path &fs_root,
const mask &selection,
const mask &subtree,
bool allow_over,
bool warn_over,
bool info_details,
bool detruire,
bool only_more_recent,
const mask & ea_mask,
bool flat,
inode::comparison_fields what_to_check,
bool warn_remove_no_match,
const infinint & hourshift,
bool empty,
bool ea_erase,
bool display_skipped,
statistics * progressive_report,
U_16 & exception,
std::string & except_msg);
/// this is wrapper around the op_listing method
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern void op_listing_noexcept(user_interaction & dialog,
archive *ptr,
bool info_details,
archive::listformat list_mode,
const mask &selection,
bool filter_unsaved,
U_16 & exception,
std::string & except_msg);
/// this is wrapper around the op_diff method
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern statistics op_diff_noexcept(user_interaction & dialog,
archive *ptr,
const path & fs_root,
const mask &selection,
const mask &subtree,
bool info_details,
const mask & ea_mask,
inode::comparison_fields what_to_check,
bool alter_atime,
bool display_skipped,
statistics * progressive_report,
U_16 & exception,
std::string & except_msg);
/// this is wrapper around the op_test method
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern statistics op_test_noexcept(user_interaction & dialog,
archive *ptr,
const mask &selection,
const mask &subtree,
bool info_details,
bool display_skipped,
statistics * progressive_report,
U_16 & exception,
std::string & except_msg);
/// this is wrapper around the get_children_of method
/// check the archive class for details
/// for an explaination of the two extra arguments exception and except_msg check
/// the get_version_noexcept function
extern bool get_children_of_noexcept(user_interaction & dialog,
archive *ptr,
const std::string & dir,
U_16 & exception,
std::string & except_msg);
///////////////////////////////////////////////
// TOOLS ROUTINES //
///////////////////////////////////////////////
/// routine provided to convert std::string to char *
/// \param[in] x the string to convert
/// \param[out] exception the return status of the call
/// \param[out] except_msg the message taken from the caught exception in case of error
/// for an explaination of the two last arguments exception and except_msg check
/// the get_version_noexcept function
/// \return the address of a newly allocated memory
/// which must be released calling the "delete []"
/// operator when no more needed.
/// \return NULL in case of error
extern char *libdar_str2charptr_noexcept(const std::string & x, U_16 & exception, std::string & except_msg);
}
#include "/usr/include/dar/criterium.hpp"
namespace libdar_4_4
{
/// Defines an overwriting policy based on pre 2.4.0 options
/// \param[in] allow_over whether overwriting is allowed or forbidden at all
/// \param[in] detruire whether "restoration" of file recorded as deleted is allowed (in other words, whether file removal at restoration time is allowed)
/// \param[in] more_recent whether to only restore more recent files
/// \param[in] hourshift the hourshift to use to compare "more recent" dates
/// \param[in] ea_erase whether to erase existing EA before restoring them from archive
/// \param[out] overwrite that will be set to a newly allocated object to be deleted by the caller at a later time
extern void tools_4_4_build_compatible_overwriting_policy(bool allow_over,
bool detruire,
bool more_recent,
const libdar::infinint & hourshift,
bool ea_erase,
const libdar::crit_action * & overwrite);
///////////////////////////////////////////////
// THREAD CANCELLATION ROUTINES //
///////////////////////////////////////////////
#if LIBDAR_MUTEX_WORKS
/// thread cancellation activation
/// ask that any libdar code running in the thread given as argument be cleanly aborted
/// when the execution will reach the next libdar checkpoint
/// \param[in] tid is the Thread ID to cancel libdar in
/// \param[in] immediate set to false, libdar will abort nicely terminating the current work and producing a usable archive for example
/// \param[in] flag is an arbitrary value that is passed through libdar
inline void cancel_thread(pthread_t tid, bool immediate = true, U_64 flag = 0) { thread_cancellation::cancel(tid, immediate, flag); }
/// consultation of the cancellation status of a given thread
/// \param[in] tid is the tid of the thread to get status about
/// \return false if no cancellation has been requested for the given thread
inline bool cancel_status(pthread_t tid) { return thread_cancellation::cancel_status(tid); }
/// thread cancellation deactivation
/// abort the thread cancellation for the given thread
/// \return false if no thread cancellation was under process for that thread
/// or if there is no more pending cancellation (thread has already been canceled).
inline bool cancel_clear(pthread_t tid) { return thread_cancellation::clear_pending_request(tid); }
#endif
/// @}
} // end of namespace
#endif
|