ARCHIVE_ENTRY(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– ARCHIVE_ENTRY πŸ’–

okay bestie, welcome to the archive_entry page from the Library Functions Manual β€” aka the libarchive girlies' guide to managing archive entry descriptions. she's giving very important, she's giving fundamental, and honestly? she ate. πŸŽ€


🌈 LIBRARY 🌈

Streaming Archive Library (libarchive, -larchive) β€” yup, that's the one, that's the queen. πŸ‘‘


✨ SYNOPSIS ✨

#include <archive_entry.h>

struct archive_entry *
archive_entry_clear(struct archive_entry *);

struct archive_entry *
archive_entry_clone(struct archive_entry *);

void
archive_entry_free(struct archive_entry *);

struct archive_entry *
archive_entry_new(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

So these functions create and manipulate data objects that represent entries within an archive. Think of a struct archive_entry as a heavy-duty version of struct stat: it's got everything from struct stat plus associated pathname, textual group and user names, etc. πŸ’…

These objects get used by libarchive(3) to represent the metadata associated with a particular entry in an archive. iconic behavior, no notes. 🌸

πŸŽ€ Create and Destroy πŸŽ€

There are functions to allocate, destroy, clear, and copy archive_entry objects:

  • archive_entry_clear() β€” Erases the object, resetting all internal fields to the same state as a newly-created object. It's literally there so you can quickly recycle objects without thrashing the heap. sustainable queen ♻️
  • archive_entry_clone() β€” A deep copy operation; all text fields are duplicated. not a shallow little thing, she goes deep. πŸ’…
  • archive_entry_free() β€” Releases the struct archive_entry object. bye bestie 🫢
  • archive_entry_new() β€” Allocate and return a blank struct archive_entry object. fresh out the box, blank slate energy ✨

🌟 Function groups 🌟

Due to the high number of functions, the accessor functions can be found in man pages grouped by purpose:

Most of the functions set or read entries in an object. Such functions have one of the following forms:

  • archive_entry_set_XXXX() β€” Stores the provided data in the object. In particular, for strings, the pointer is stored, not the referenced string. ⚠️ (read that twice bestie, that's a real one)
  • archive_entry_copy_XXXX() β€” As above, except that the referenced data is copied into the object. the responsible sibling fr fr 🫢
  • archive_entry_XXXX() β€” Returns the specified data. In the case of strings, a const-qualified pointer to the string is returned.

String data can be set or accessed as wide character strings or normal char strings. The functions that use wide character strings are suffixed with _w. πŸ“

Note that these are different representations of the same data: for example, if you store a narrow string and read the corresponding wide string, the object will transparently convert formats using the current locale. Similarly, if you store a wide string and then store a narrow string for the same data, the previously-set wide string will be discarded in favor of the new data. the way she just swaps them out?? main character energy, honestly πŸ’…

πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

The libarchive library first appeared in FreeBSD 5.3. a whole era. ⭐


🫢 AUTHORS 🫢

The libarchive library was written by Tim Kientzle <kientzle@acm.org>. thank you king πŸ‘‘


and that's the whole page, bestie!! this one came from the Debian build, dated February 2, 2012 β€” vintage but still absolutely serving πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from