Deleted Added
full compact
archive.h (228763) archive.h (228773)
1/*-
2 * Copyright (c) 2003-2007 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 8 unchanged lines hidden (view full) ---

17 * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
1/*-
2 * Copyright (c) 2003-2007 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 8 unchanged lines hidden (view full) ---

17 * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * $FreeBSD: head/contrib/libarchive/libarchive/archive.h 228763 2011-12-21 11:13:29Z mm $
25 * $FreeBSD: head/contrib/libarchive/libarchive/archive.h 228773 2011-12-21 15:18:52Z mm $
26 */
27
28#ifndef ARCHIVE_H_INCLUDED
29#define ARCHIVE_H_INCLUDED
30
31/*
32 * Note: archive.h is for use outside of libarchive; the configuration
33 * headers (config.h, archive_platform.h, etc.) are purely internal.

--- 454 unchanged lines hidden (view full) ---

488/* Record the dev/ino of a file that will not be written. This is
489 * generally set to the dev/ino of the archive being read. */
490__LA_DECL void archive_read_extract_set_skip_file(struct archive *,
491 dev_t, ino_t);
492
493/* Close the file and release most resources. */
494__LA_DECL int archive_read_close(struct archive *);
495/* Release all resources and destroy the object. */
26 */
27
28#ifndef ARCHIVE_H_INCLUDED
29#define ARCHIVE_H_INCLUDED
30
31/*
32 * Note: archive.h is for use outside of libarchive; the configuration
33 * headers (config.h, archive_platform.h, etc.) are purely internal.

--- 454 unchanged lines hidden (view full) ---

488/* Record the dev/ino of a file that will not be written. This is
489 * generally set to the dev/ino of the archive being read. */
490__LA_DECL void archive_read_extract_set_skip_file(struct archive *,
491 dev_t, ino_t);
492
493/* Close the file and release most resources. */
494__LA_DECL int archive_read_close(struct archive *);
495/* Release all resources and destroy the object. */
496/* Note that archive_read_finish will call archive_read_close for you. */
497#if ARCHIVE_VERSION_NUMBER < 2000000
498/* Erroneously declared to return void in libarchive 1.x */
499__LA_DECL void archive_read_finish(struct archive *);
500#else
496/* Note that archive_read_free will call archive_read_close for you. */
497__LA_DECL int archive_read_free(struct archive *);
498#if ARCHIVE_VERSION_NUMBER < 4000000
499/* Synonym for archive_read_free() for backwards compatibility. */
501__LA_DECL int archive_read_finish(struct archive *);
502#endif
503
504/*-
505 * To create an archive:
506 * 1) Ask archive_write_new for a archive writer object.
507 * 2) Set any global properties. In particular, you should set
508 * the compression and format to use.
509 * 3) Call archive_write_open to open the file (most people
510 * will use archive_write_open_file or archive_write_open_fd,
511 * which provide convenient canned I/O callbacks for you).
512 * 4) For each entry:
513 * - construct an appropriate struct archive_entry structure
514 * - archive_write_header to write the header
515 * - archive_write_data to write the entry data
516 * 5) archive_write_close to close the output
500__LA_DECL int archive_read_finish(struct archive *);
501#endif
502
503/*-
504 * To create an archive:
505 * 1) Ask archive_write_new for a archive writer object.
506 * 2) Set any global properties. In particular, you should set
507 * the compression and format to use.
508 * 3) Call archive_write_open to open the file (most people
509 * will use archive_write_open_file or archive_write_open_fd,
510 * which provide convenient canned I/O callbacks for you).
511 * 4) For each entry:
512 * - construct an appropriate struct archive_entry structure
513 * - archive_write_header to write the header
514 * - archive_write_data to write the entry data
515 * 5) archive_write_close to close the output
517 * 6) archive_write_finish to cleanup the writer and release resources
516 * 6) archive_write_free to cleanup the writer and release resources
518 */
519__LA_DECL struct archive *archive_write_new(void);
520__LA_DECL int archive_write_set_bytes_per_block(struct archive *,
521 int bytes_per_block);
522__LA_DECL int archive_write_get_bytes_per_block(struct archive *);
523/* XXX This is badly misnamed; suggestions appreciated. XXX */
524__LA_DECL int archive_write_set_bytes_in_last_block(struct archive *,
525 int bytes_in_last_block);

--- 64 unchanged lines hidden (view full) ---

590 const void *, size_t, off_t);
591#else
592/* Libarchive 3.0 uses explicit int64_t to ensure consistent 64-bit support. */
593__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *,
594 const void *, size_t, __LA_INT64_T);
595#endif
596__LA_DECL int archive_write_finish_entry(struct archive *);
597__LA_DECL int archive_write_close(struct archive *);
517 */
518__LA_DECL struct archive *archive_write_new(void);
519__LA_DECL int archive_write_set_bytes_per_block(struct archive *,
520 int bytes_per_block);
521__LA_DECL int archive_write_get_bytes_per_block(struct archive *);
522/* XXX This is badly misnamed; suggestions appreciated. XXX */
523__LA_DECL int archive_write_set_bytes_in_last_block(struct archive *,
524 int bytes_in_last_block);

--- 64 unchanged lines hidden (view full) ---

589 const void *, size_t, off_t);
590#else
591/* Libarchive 3.0 uses explicit int64_t to ensure consistent 64-bit support. */
592__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *,
593 const void *, size_t, __LA_INT64_T);
594#endif
595__LA_DECL int archive_write_finish_entry(struct archive *);
596__LA_DECL int archive_write_close(struct archive *);
598#if ARCHIVE_VERSION_NUMBER < 2000000
599/* Return value was incorrect in libarchive 1.x. */
600__LA_DECL void archive_write_finish(struct archive *);
601#else
602/* Libarchive 2.x and later returns an error if this fails. */
603/* It can fail if the archive wasn't already closed, in which case
604 * archive_write_finish() will implicitly call archive_write_close(). */
597
598/* This can fail if the archive wasn't already closed, in which case
599 * archive_write_free() will implicitly call archive_write_close(). */
600__LA_DECL int archive_write_free(struct archive *);
601#if ARCHIVE_VERSION_NUMBER < 4000000
602/* Synonym for archive_write_free() for backwards compatibility. */
605__LA_DECL int archive_write_finish(struct archive *);
606#endif
607
608/*
609 * Set write options.
610 */
611/* Apply option string to the format only. */
612__LA_DECL int archive_write_set_format_options(struct archive *_a,

--- 12 unchanged lines hidden (view full) ---

625 * To create objects on disk:
626 * 1) Ask archive_write_disk_new for a new archive_write_disk object.
627 * 2) Set any global properties. In particular, you probably
628 * want to set the options.
629 * 3) For each entry:
630 * - construct an appropriate struct archive_entry structure
631 * - archive_write_header to create the file/dir/etc on disk
632 * - archive_write_data to write the entry data
603__LA_DECL int archive_write_finish(struct archive *);
604#endif
605
606/*
607 * Set write options.
608 */
609/* Apply option string to the format only. */
610__LA_DECL int archive_write_set_format_options(struct archive *_a,

--- 12 unchanged lines hidden (view full) ---

623 * To create objects on disk:
624 * 1) Ask archive_write_disk_new for a new archive_write_disk object.
625 * 2) Set any global properties. In particular, you probably
626 * want to set the options.
627 * 3) For each entry:
628 * - construct an appropriate struct archive_entry structure
629 * - archive_write_header to create the file/dir/etc on disk
630 * - archive_write_data to write the entry data
633 * 4) archive_write_finish to cleanup the writer and release resources
631 * 4) archive_write_free to cleanup the writer and release resources
634 *
635 * In particular, you can use this in conjunction with archive_read()
636 * to pull entries out of an archive and create them on disk.
637 */
638__LA_DECL struct archive *archive_write_disk_new(void);
639/* This file will not be overwritten. */
640__LA_DECL int archive_write_disk_set_skip_file(struct archive *,
641 dev_t, ino_t);

--- 107 unchanged lines hidden ---
632 *
633 * In particular, you can use this in conjunction with archive_read()
634 * to pull entries out of an archive and create them on disk.
635 */
636__LA_DECL struct archive *archive_write_disk_new(void);
637/* This file will not be overwritten. */
638__LA_DECL int archive_write_disk_set_skip_file(struct archive *,
639 dev_t, ino_t);

--- 107 unchanged lines hidden ---