archive_entry.3 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. .TH ARCHIVE_ENTRY 3 "February 2, 2012" ""
  2. .SH NAME
  3. .ad l
  4. \fB\%archive_entry_clear\fP,
  5. \fB\%archive_entry_clone\fP,
  6. \fB\%archive_entry_free\fP,
  7. \fB\%archive_entry_new\fP
  8. \- functions for managing archive entry descriptions
  9. .SH LIBRARY
  10. .ad l
  11. Streaming Archive Library (libarchive, -larchive)
  12. .SH SYNOPSIS
  13. .ad l
  14. \fB#include <archive_entry.h>\fP
  15. .br
  16. \fIstruct archive_entry *\fP
  17. .br
  18. \fB\%archive_entry_clear\fP(\fI\%struct\ archive_entry\ *\fP);
  19. .br
  20. \fIstruct archive_entry *\fP
  21. .br
  22. \fB\%archive_entry_clone\fP(\fI\%struct\ archive_entry\ *\fP);
  23. .br
  24. \fIvoid\fP
  25. .br
  26. \fB\%archive_entry_free\fP(\fI\%struct\ archive_entry\ *\fP);
  27. .br
  28. \fIstruct archive_entry *\fP
  29. .br
  30. \fB\%archive_entry_new\fP(\fI\%void\fP);
  31. .SH DESCRIPTION
  32. .ad l
  33. These functions create and manipulate data objects that
  34. represent entries within an archive.
  35. You can think of a
  36. Tn struct archive_entry
  37. as a heavy-duty version of
  38. Tn struct stat:
  39. it includes everything from
  40. Tn struct stat
  41. plus associated pathname, textual group and user names, etc.
  42. These objects are used by
  43. \fBlibarchive\fP(3)
  44. to represent the metadata associated with a particular
  45. entry in an archive.
  46. .SS Create and Destroy
  47. There are functions to allocate, destroy, clear, and copy
  48. \fIarchive_entry\fP
  49. objects:
  50. .RS 5
  51. .TP
  52. \fB\%archive_entry_clear\fP()
  53. Erases the object, resetting all internal fields to the
  54. same state as a newly-created object.
  55. This is provided to allow you to quickly recycle objects
  56. without thrashing the heap.
  57. .TP
  58. \fB\%archive_entry_clone\fP()
  59. A deep copy operation; all text fields are duplicated.
  60. .TP
  61. \fB\%archive_entry_free\fP()
  62. Releases the
  63. Tn struct archive_entry
  64. object.
  65. .TP
  66. \fB\%archive_entry_new\fP()
  67. Allocate and return a blank
  68. Tn struct archive_entry
  69. object.
  70. .RE
  71. .SS Function groups
  72. Due to high number of functions, the accessor functions can be found in
  73. man pages grouped by the purpose.
  74. .RS 5
  75. .TP
  76. \fBarchive_entry_acl\fP(3)
  77. Access Control List manipulation
  78. .TP
  79. \fBarchive_entry_paths\fP(3)
  80. Path name manipulation
  81. .TP
  82. \fBarchive_entry_perms\fP(3)
  83. User, group and mode manipulation
  84. .TP
  85. \fBarchive_entry_stat\fP(3)
  86. Functions not in the other groups and copying to/from
  87. Vt struct stat.
  88. .TP
  89. \fBarchive_entry_time\fP(3)
  90. Time field manipulation
  91. .RE
  92. .PP
  93. Most of the functions set or read entries in an object.
  94. Such functions have one of the following forms:
  95. .RS 5
  96. .TP
  97. \fB\%archive_entry_set_XXXX\fP()
  98. Stores the provided data in the object.
  99. In particular, for strings, the pointer is stored,
  100. not the referenced string.
  101. .TP
  102. \fB\%archive_entry_copy_XXXX\fP()
  103. As above, except that the referenced data is copied
  104. into the object.
  105. .TP
  106. \fB\%archive_entry_XXXX\fP()
  107. Returns the specified data.
  108. In the case of strings, a const-qualified pointer to
  109. the string is returned.
  110. .RE
  111. String data can be set or accessed as wide character strings
  112. or normal
  113. \fIchar\fP
  114. strings.
  115. The functions that use wide character strings are suffixed with
  116. \fB_w\fP.
  117. Note that these are different representations of the same data:
  118. For example, if you store a narrow string and read the corresponding
  119. wide string, the object will transparently convert formats
  120. using the current locale.
  121. Similarly, if you store a wide string and then store a
  122. narrow string for the same data, the previously-set wide string will
  123. be discarded in favor of the new data.
  124. .SH SEE ALSO
  125. .ad l
  126. \fBarchive_entry_acl\fP(3),
  127. \fBarchive_entry_paths\fP(3),
  128. \fBarchive_entry_perms\fP(3),
  129. \fBarchive_entry_time\fP(3),
  130. \fBlibarchive\fP(3)
  131. .SH HISTORY
  132. .ad l
  133. The
  134. \fB\%libarchive\fP
  135. library first appeared in
  136. FreeBSD 5.3.
  137. .SH AUTHORS
  138. .ad l
  139. -nosplit
  140. The
  141. \fB\%libarchive\fP
  142. library was written by
  143. Tim Kientzle \%<[email protected].>