Imported Upstream version 3.2.0
[platform/upstream/libarchive.git] / doc / wiki / ManPageArchiveReadExtract3.wiki
1 ARCHIVE_READ_EXTRACT(3) manual page 
2 == NAME == 
3 '''archive_read_extract''', 
4 '''archive_read_extract2''', 
5 '''archive_read_extract_set_progress_callback''' 
6 - functions for reading streaming archives 
7 == LIBRARY == 
8 Streaming Archive Library (libarchive, -larchive) 
9 == SYNOPSIS == 
10 '''<nowiki>#include <archive.h></nowiki>''' 
11 <br> 
12 ''int'' 
13 <br> 
14 '''archive_read_extract'''(''struct archive *'', ''struct archive_entry *'', ''int flags''); 
15 <br> 
16 ''int'' 
17 <br> 
18 '''archive_read_extract2'''(''struct archive *src'', ''struct archive_entry *'', ''struct archive *dest''); 
19 <br> 
20 ''void'' 
21 <br> 
22 '''archive_read_extract_set_progress_callback'''(''struct archive *'', ''void (*func)(void *)'', ''void *user_data''); 
23 == DESCRIPTION == 
24 <dl> 
25 <dt>'''archive_read_extract'''(), '''archive_read_extract_set_skip_file'''()</dt><dd> 
26 A convenience function that wraps the corresponding 
27 [[ManPagerchiveriteisk3]] 
28 interfaces. 
29 The first call to 
30 '''archive_read_extract'''() 
31 creates a restore object using 
32 [[ManPagerchiveriteiskew3]] 
33 and 
34 [[ManPagerchiveriteiskettandardookup3]], 
35 then transparently invokes 
36 [[ManPagerchiveriteisketptions3]], 
37 [[ManPagerchiveriteeader3]], 
38 [[ManPagerchiveriteata3]], 
39 and 
40 [[ManPagerchiveriteinishntry3]] 
41 to create the entry on disk and copy data into it. 
42 The 
43 ''flags'' 
44 argument is passed unmodified to 
45 [[ManPagerchiveriteisketptions3]]. 
46 </dd><dt>'''archive_read_extract2'''()</dt><dd> 
47 This is another version of 
48 '''archive_read_extract'''() 
49 that allows you to provide your own restore object. 
50 In particular, this allows you to override the standard lookup functions 
51 using 
52 [[ManPagerchiveriteisketroupookup3]], 
53 and 
54 [[ManPagerchiveriteisketserookup3]]. 
55 Note that 
56 '''archive_read_extract2'''() 
57 does not accept a 
58 ''flags'' 
59 argument; you should use 
60 '''archive_write_disk_set_options'''() 
61 to set the restore options yourself. 
62 </dd><dt>'''archive_read_extract_set_progress_callback'''()</dt><dd> 
63 Sets a pointer to a user-defined callback that can be used 
64 for updating progress displays during extraction. 
65 The progress function will be invoked during the extraction of large 
66 regular files. 
67 The progress function will be invoked with the pointer provided to this call. 
68 Generally, the data pointed to should include a reference to the archive 
69 object and the archive_entry object so that various statistics 
70 can be retrieved for the progress display. 
71 </dd></dl> 
72 == RETURN VALUES == 
73 Most functions return zero on success, non-zero on error. 
74 The possible return codes include: 
75 '''ARCHIVE_OK''' 
76 (the operation succeeded), 
77 '''ARCHIVE_WARN''' 
78 (the operation succeeded but a non-critical error was encountered), 
79 '''ARCHIVE_EOF''' 
80 (end-of-archive was encountered), 
81 '''ARCHIVE_RETRY''' 
82 (the operation failed but can be retried), 
83 and 
84 '''ARCHIVE_FATAL''' 
85 (there was a fatal error; the archive should be closed immediately). 
86 == ERRORS == 
87 Detailed error codes and textual descriptions are available from the 
88 '''archive_errno'''() 
89 and 
90 '''archive_error_string'''() 
91 functions. 
92 == SEE ALSO == 
93 [[ManPageBsdtar1]], 
94 [[ManPageibarchive3]], 
95 [[ManPagerchiveead3]], 
96 [[ManPagerchiveeadata3]], 
97 [[ManPagerchiveeadilter3]], 
98 [[ManPagerchiveeadormat3]], 
99 [[ManPagerchiveeadpen3]], 
100 [[ManPagerchiveeadetptions3]], 
101 [[ManPagerchivetil3]], 
102 [[ManPageTar5]]