ManPageArchiveReadExtract3.wiki 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. [[ManPageArchiveWriteDisk3]]
  28. interfaces.
  29. The first call to
  30. '''archive_read_extract'''()
  31. creates a restore object using
  32. [[ManPageArchiveWriteDiskNew3]]
  33. and
  34. [[ManPageArchiveWriteDiskSetStandardLookup3]],
  35. then transparently invokes
  36. [[ManPageArchiveWriteDiskSetOptions3]],
  37. [[ManPageArchiveWriteHeader3]],
  38. [[ManPageArchiveWriteData3]],
  39. and
  40. [[ManPageArchiveWriteFinishEntry3]]
  41. to create the entry on disk and copy data into it.
  42. The
  43. ''flags''
  44. argument is passed unmodified to
  45. [[ManPageArchiveWriteDiskSetOptions3]].
  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. [[ManPageArchiveWriteDiskSetGroupLookup3]],
  53. and
  54. [[ManPageArchiveWriteDiskSetUserLookup3]].
  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. [[ManPageArchiveRead3]],
  95. [[ManPageArchiveReadData3]],
  96. [[ManPageArchiveReadFilter3]],
  97. [[ManPageArchiveReadFormat3]],
  98. [[ManPageArchiveReadOpen3]],
  99. [[ManPageArchiveReadSetOptions3]],
  100. [[ManPageArchiveUtil3]],
  101. [[ManPageLibarchive3]],
  102. [[ManPageTar5]]