libctf: add ctf_archive_count
Another count that was otherwise unavailable without doing expensive operations. include/ * ctf-api.h (ctf_archive_count): New. libctf/ * ctf-archive.c (ctf_archive_count): New. * libctf.ver: New public function.
This commit is contained in:
parent
e0325e2ced
commit
9c23dfa5aa
5 changed files with 21 additions and 0 deletions
|
@ -617,6 +617,16 @@ ctf_arc_open_by_offset (const struct ctf_archive *arc,
|
|||
return fp;
|
||||
}
|
||||
|
||||
/* Return the number of members in an archive. */
|
||||
size_t
|
||||
ctf_archive_count (const ctf_archive_t *wrapper)
|
||||
{
|
||||
if (!wrapper->ctfi_is_archive)
|
||||
return 1;
|
||||
|
||||
return wrapper->ctfi_archive->ctfa_nfiles;
|
||||
}
|
||||
|
||||
/* Raw iteration over all CTF files in an archive. We pass the raw data for all
|
||||
CTF files in turn to the specified callback function. */
|
||||
static int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue