Archive operations
Main wrapper functions for primary library functions. More...Data Structures | |
struct | dar_archive |
Incomplete struct for use as an archive object pointer. More... | |
struct | dar_sup_exception |
Container for exceptions that occur during operations. More... | |
struct | dar_sup_flags |
A collection of flags toogling various types of operations. More... | |
struct | dar_sup_libfeature |
Used to hold results when querying for available library features. More... | |
struct | dar_sup_libversion |
Used to assist runtime version verification during library initialization. More... | |
struct | dar_sup_spec |
A collection of options regarding archive location and contents. More... | |
struct | dar_sup_storage |
A collection of options regarding archive storage options. More... | |
Library initialization | |
Calling dar_op_library_init_macro is the easiest way to verify and initialize the library, but care must be taken to free the returned memory.
Initialization may be performed manually as well. | |
#define | DAR_LIBRARY_INIT_MACRO(ref) |
Convenience macro for library initialization. | |
Functions | |
NAMESPACE_LIBDAR_START void | dar_sup_libversion_destroy (dar_sup_libversion *ref) |
Frees any memory allocated for the members of the struct. | |
bool | dar_op_library_init (dar_sup_libversion *inout) |
Initializes library and performs version verification. | |
void | dar_sup_libfeature_destroy (dar_sup_libfeature *ref) |
Frees any memory allocated for the members of the struct. | |
void | dar_op_libfeature_query (dar_sup_libfeature *ref) |
Provides complete information regarding the compiled options of the backing dar library. | |
void | dar_archive_destroy (dar_archive *ref) |
Frees memory used by dar_archive object. | |
bool | dar_sup_spec_defaults (dar_sup_spec *ref) |
Initializes a dar_sup_spec struct with default values. | |
void | dar_sup_spec_destroy (dar_sup_spec *ref) |
Frees any memory allocated for the members of the struct. | |
bool | dar_sup_storage_defaults (dar_sup_storage *ref) |
Initializes a dar_sup_storage struct with default values. | |
void | dar_sup_storage_destroy (dar_sup_storage *ref) |
Frees any memory allocated for the members of the struct. | |
void | dar_sup_flags_defaults (dar_sup_flags *ref) |
Initializes a dar_sup_flags struct with default values. | |
void | dar_sup_exception_destroy (dar_sup_exception *ref) |
Frees any memory allocated for the members of the struct. | |
dar_archive * | dar_op_archive_create (dar_user_interaction_struct dialog, dar_archive *ref_archive, dar_sup_spec archive_options, dar_sup_storage format_options, dar_sup_flags option_flags, dar_statistics *operation_stats, dar_sup_exception *exception) |
Create a new archive. | |
bool | dar_op_archive_get_children_of (dar_user_interaction_struct dialog, dar_archive *archive, char *directory, dar_sup_exception *exception) |
Obtain a listing of any children of a given path of a file in an archive. | |
dar_archive * | dar_op_archive_isolate (dar_user_interaction_struct dialog, dar_archive *ref_archive, dar_sup_spec archive_options, dar_sup_storage format_options, dar_sup_flags option_flags, dar_sup_exception *exception) |
Isolates a catalog from a given archive and places it in a new empty archive. | |
bool | dar_op_archive_diff (dar_user_interaction_struct dialog, dar_archive *archive, dar_sup_spec archive_options, dar_sup_flags option_flags, dar_statistics *operation_stats, dar_sup_exception *exception) |
Compares an archive with the filesystem. | |
bool | dar_op_archive_extract (dar_user_interaction_struct dialog, dar_archive *archive, dar_sup_spec archive_options, dar_sup_storage format_options, dar_sup_flags option_flags, dar_statistics *operation_stats, dar_sup_exception *exception) |
Extracts data from an archive, restoring it onto the file system. | |
bool | dar_op_archive_list (dar_user_interaction_struct dialog, dar_archive *archive, dar_sup_spec archive_options, dar_sup_flags option_flags, dar_sup_exception *exception) |
Lists files in the archive according to a selection filter. | |
bool | dar_op_archive_test (dar_user_interaction_struct dialog, dar_archive *archive, dar_sup_spec archive_options, dar_statistics *operation_stats, dar_sup_exception *exception) |
Tests an archive's integrity. | |
bool | dar_op_archive_close (dar_archive *archive, dar_sup_exception *exception) |
Closes an open archive. | |
dar_archive * | dar_op_archive_open (dar_user_interaction_struct dialog, dar_sup_spec archive_options, dar_sup_storage format_options, dar_sup_exception *exception) |
Opens an archive, reading its catalog into memory. |
Detailed Description
Main wrapper functions for primary library functions.
Define Documentation
|
Value: ref.major = LIBDARC_MAJOR_VERSION; \ ref.minor = LIBDARC_MINOR_VERSION; \ ref.micro = LIBDARC_MICRO_VERSION; \ dar_op_library_init(&ref)
When using
An uninitialized |
Function Documentation
|
Closes an open archive. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path Archive path Archive name Archive extension Input pipe Output pipe Selection mask Subtree mask FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm Encryption block size Encryption passphrase File size First file size Slice excecute command Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite Warn overwrite Slice pause Create empty stubs System EA User EA No dump Ignore owner Test run Alter atime Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 1029 of file libdarc.cpp. References LIBDAR_NOEXCEPT, and LIBDARC_EXCEPTION. |
|
Create a new archive.
The library will archive files from the given file system paths into one or more slice files. The slices, inserted in the indicated directory, will be named Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path X Archive path X Archive name X Archive extension X Input pipe Output pipe Selection mask X Subtree mask X FORMAT OPTIONS (dar_sup_storage) Compression algorithm X Compression level X Compression mask X Compression min. size X Encryption algorithm X Encryption block size X Encryption passphrase X File size X First file size X Slice excecute command X Hourshift X OPTION FLAGS (dar_sup_flags) Allow overwrite X Warn overwrite X Slice pause X Create empty stubs X System EA X User EA X No dump X Ignore owner X Test run X Alter atime X Same file system X Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 467 of file libdarc.cpp. References dar_sup_flags::allow_overwrite, dar_sup_flags::alter_atime, dar_sup_spec::arc_ext, dar_sup_spec::arc_name, dar_sup_spec::arc_path, dar_sup_storage::compress_algo, dar_sup_storage::compress_level, dar_sup_storage::compress_mask, dar_sup_storage::compress_min_size, dar_sup_flags::create_empty_stubs, dar_sup_storage::crypto_algo, dar_sup_storage::crypto_pass, dar_sup_storage::crypto_size, dar_user_interaction_struct_is_valid(), dar_sup_flags::ea_system, dar_sup_flags::ea_user, dar_sup_storage::file_size, dar_sup_storage::first_file_size, dar_sup_storage::hourshift, dar_sup_flags::ignore_owner, LIBDAR_ELIBCALL, LIBDAR_EMEMORY, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_flags::no_dump, dar_sup_spec::root_path, dar_sup_flags::same_fs, dar_sup_spec::selection, dar_sup_storage::slice_execute, dar_sup_flags::slice_pause, dar_sup_spec::subtree, dar_sup_flags::test_run, dar_user_interaction_struct::verbose, and dar_sup_flags::warn_overwrite. |
|
Compares an archive with the filesystem. FIXME: (1) how are differences indicated in callbacks? (2) how exactly are statistics returned? Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path X Archive path Archive name Archive extension Input pipe Output pipe Selection mask X Subtree mask X FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm Encryption block size Encryption passphrase File size First file size Slice excecute command Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite Warn overwrite Slice pause Create empty stubs System EA X User EA X No dump Ignore owner X Test run Alter atime X Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 753 of file libdarc.cpp. References dar_sup_flags::alter_atime, dar_user_interaction_struct_is_valid(), dar_sup_flags::ea_system, dar_sup_flags::ea_user, dar_sup_flags::ignore_owner, LIBDAR_ELIBCALL, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_spec::root_path, dar_sup_spec::selection, dar_sup_spec::subtree, and dar_user_interaction_struct::verbose. |
|
Extracts data from an archive, restoring it onto the file system. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path X Archive path Archive name Archive extension Input pipe Output pipe Selection mask X Subtree mask X FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm Encryption block size Encryption passphrase File size First file size Slice excecute command Hourshift X OPTION FLAGS (dar_sup_flags) Allow overwrite X Warn overwrite X Slice pause Create empty stubs System EA X User EA X No dump Ignore owner Test run X Alter atime Same file system Delete marked X Restore flat X Warn rem. non-matching X Only restore more recent X Tar format listing Filter unsaved
Definition at line 828 of file libdarc.cpp. References dar_sup_flags::allow_overwrite, dar_user_interaction_struct_is_valid(), dar_sup_flags::delete_marked, dar_sup_flags::ea_system, dar_sup_flags::ea_user, dar_sup_storage::hourshift, dar_sup_flags::ignore_owner, LIBDAR_ELIBCALL, LIBDAR_EMEMORY, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_flags::only_more_recent, dar_sup_flags::restore_flat, dar_sup_spec::root_path, dar_sup_spec::selection, dar_sup_spec::subtree, dar_sup_flags::test_run, dar_user_interaction_struct::verbose, dar_sup_flags::warn_overwrite, and dar_sup_flags::warn_remove_no_match. |
|
Obtain a listing of any children of a given path of a file in an archive. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path Archive path Archive name Archive extension Input pipe Output pipe Selection mask Subtree mask FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm Encryption block size Encryption passphrase File size First file size Slice excecute command Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite Warn overwrite Slice pause Create empty stubs System EA User EA No dump Ignore owner Test run Alter atime Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 613 of file libdarc.cpp. References dar_user_interaction_struct_is_valid(), LIBDAR_ELIBCALL, LIBDAR_NOEXCEPT, and LIBDARC_EXCEPTION. |
|
Isolates a catalog from a given archive and places it in a new empty archive. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path Archive path X Archive name X Archive extension X Input pipe Output pipe Selection mask Subtree mask FORMAT OPTIONS (dar_sup_storage) Compression algorithm X Compression level X Compression mask Compression min. size Encryption algorithm X Encryption block size X Encryption passphrase X File size X First file size X Slice excecute command X Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite X Warn overwrite X Slice pause X Create empty stubs System EA User EA No dump Ignore owner Test run X Alter atime Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 653 of file libdarc.cpp. References dar_sup_flags::allow_overwrite, dar_sup_spec::arc_ext, dar_sup_spec::arc_name, dar_sup_spec::arc_path, dar_sup_storage::compress_algo, dar_sup_storage::compress_level, dar_sup_flags::create_empty_stubs, dar_sup_storage::crypto_algo, dar_sup_storage::crypto_pass, dar_sup_storage::crypto_size, dar_user_interaction_struct_is_valid(), dar_sup_storage::file_size, dar_sup_storage::first_file_size, LIBDAR_ELIBCALL, LIBDAR_EMEMORY, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_storage::slice_execute, dar_sup_flags::slice_pause, dar_sup_flags::test_run, and dar_user_interaction_struct::verbose. |
|
Lists files in the archive according to a selection filter. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path Archive path Archive name Archive extension Input pipe Output pipe Selection mask X Subtree mask FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm Encryption block size Encryption passphrase File size First file size Slice excecute command Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite Warn overwrite Slice pause Create empty stubs System EA User EA No dump Ignore owner Test run Alter atime Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing X Filter unsaved X
Definition at line 930 of file libdarc.cpp. References dar_user_interaction_struct_is_valid(), dar_sup_flags::filter_unsaved, LIBDAR_ELIBCALL, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_spec::selection, dar_sup_flags::tar_format, and dar_user_interaction_struct::verbose. |
|
Opens an archive, reading its catalog into memory. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path Archive path X Archive name X Archive extension X Input pipe X Output pipe X Selection mask Subtree mask FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm X Encryption block size X Encryption passphrase X File size First file size Slice excecute command X Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite Warn overwrite Slice pause Create empty stubs System EA User EA No dump Ignore owner Test run Alter atime Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 1055 of file libdarc.cpp. References dar_sup_spec::arc_ext, dar_sup_spec::arc_name, dar_sup_spec::arc_path, dar_sup_storage::crypto_algo, dar_sup_storage::crypto_pass, dar_sup_storage::crypto_size, dar_user_interaction_struct_is_valid(), dar_sup_spec::input_pipe, LIBDAR_ELIBCALL, LIBDAR_EMEMORY, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_spec::output_pipe, dar_sup_storage::slice_execute, and dar_user_interaction_struct::verbose. Referenced by dar_drc_open_reference(). |
|
Tests an archive's integrity. This function may not be called with an archive object recieved directly from the isolation or creation functions. Because those objects will not reflect any actual on disk write errors they must be destroyed after creation. The archive must then be freshly read in from disk and then tested. Field usage:
Field name Used ARCHIVE OPTIONS (dar_sup_spec) Root path Archive path Archive name Archive extension Input pipe Output pipe Selection mask X Subtree mask X FORMAT OPTIONS (dar_sup_storage) Compression algorithm Compression level Compression mask Compression min. size Encryption algorithm Encryption block size Encryption passphrase File size First file size Slice excecute command Hourshift OPTION FLAGS (dar_sup_flags) Allow overwrite Warn overwrite Slice pause Create empty stubs System EA User EA No dump Ignore owner Test run Alter atime Same file system Delete marked Restore flat Warn rem. non-matching Only restore more recent Tar format listing Filter unsaved
Definition at line 978 of file libdarc.cpp. References dar_user_interaction_struct_is_valid(), LIBDAR_ELIBCALL, LIBDAR_NOEXCEPT, LIBDARC_EXCEPTION, dar_sup_spec::selection, dar_sup_spec::subtree, and dar_user_interaction_struct::verbose. |
|
Provides complete information regarding the compiled options of the backing dar library.
This information can be used to filter unsupported calls, etc. When an operation is performed using an unsupported option (e.g. selected gzip compression when the gzip library is not available) said operation will fail, returning a
Any memory allocated to the structure must be cleared by passing it to Definition at line 124 of file libdarc.cpp. References dar_sup_libfeature::ea, dar_sup_libfeature::largefile, dar_sup_libfeature::libbz2, dar_sup_libfeature::libcrypto, dar_sup_libfeature::libz, dar_sup_libfeature::nodump, dar_sup_libfeature::os_bits, dar_sup_libfeature::special_alloc, and dar_sup_libfeature::thread_safe. |
|
Initializes library and performs version verification. Binding user must provide compile time version as input. The input version parameter will be replaced with the actual runtime binding version. If the linked shared library is an invalid version, false will be returned and the exception data will be placed in the version parameter. While the API/ABI breakage policy of the C binding the same as that of libdar the use of this function (or its automatic counterpart) is preferred. This provides an extra level of protection in case the policy changes.
Definition at line 60 of file libdarc.cpp. References dar_sup_libversion::except_msg, dar_sup_libversion::exception, LIBDAR_ELIBCALL, LIBDAR_NOEXCEPT, dar_sup_libversion::major, dar_sup_libversion::micro, and dar_sup_libversion::minor. |
|
Frees any memory allocated for the members of the struct.
Definition at line 444 of file libdarc.cpp. References dar_sup_exception::message. |
|
Initializes a
Definition at line 422 of file libdarc.cpp. References dar_sup_flags::allow_overwrite, dar_sup_flags::alter_atime, dar_sup_flags::create_empty_stubs, dar_sup_flags::delete_marked, dar_sup_flags::ea_system, dar_sup_flags::ea_user, dar_sup_flags::filter_unsaved, dar_sup_flags::ignore_owner, dar_sup_flags::no_dump, dar_sup_flags::only_more_recent, dar_sup_flags::restore_flat, dar_sup_flags::same_fs, dar_sup_flags::slice_pause, dar_sup_flags::tar_format, dar_sup_flags::test_run, dar_sup_flags::warn_overwrite, and dar_sup_flags::warn_remove_no_match. |
|
Frees any memory allocated for the members of the struct.
Definition at line 118 of file libdarc.cpp. |
|
Frees any memory allocated for the members of the struct.
Definition at line 50 of file libdarc.cpp. References dar_sup_libversion::except_msg. |
|
Initializes a
Because there are currently no default values for this struct, this function only initializes members as zero or
Definition at line 162 of file libdarc.cpp. References dar_sup_spec::arc_ext, dar_sup_spec::arc_name, dar_sup_spec::arc_path, dar_sup_spec::input_pipe, dar_sup_spec::output_pipe, dar_sup_spec::root_path, dar_sup_spec::selection, and dar_sup_spec::subtree. |
|
Frees any memory allocated for the members of the struct.
Definition at line 176 of file libdarc.cpp. References dar_sup_spec::arc_ext, dar_sup_spec::arc_name, dar_sup_spec::arc_path, dar_mask_destroy(), dar_sup_spec::input_pipe, dar_sup_spec::output_pipe, dar_sup_spec::root_path, dar_sup_spec::selection, and dar_sup_spec::subtree. Referenced by dar_drc_destroy(). |
|
Initializes a
All pointers will be set to
Definition at line 234 of file libdarc.cpp. References dar_sup_storage::compress_algo, dar_sup_storage::compress_level, dar_sup_storage::compress_mask, dar_sup_storage::compress_min_size, dar_sup_storage::crypto_algo, dar_sup_storage::crypto_pass, dar_sup_storage::crypto_size, dar_compression_none, dar_crypto_none, dar_sup_storage::file_size, dar_sup_storage::first_file_size, dar_sup_storage::hourshift, and dar_sup_storage::slice_execute. |
|
Frees any memory allocated for the members of the struct.
Definition at line 396 of file libdarc.cpp. References dar_sup_storage::compress_mask, dar_sup_storage::compress_min_size, dar_sup_storage::crypto_pass, dar_infinint_destroy(), dar_mask_destroy(), dar_sup_storage::file_size, dar_sup_storage::first_file_size, dar_sup_storage::hourshift, and dar_sup_storage::slice_execute. Referenced by dar_drc_destroy(). |