mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-21 06:03:54 +00:00
add queue popping functions
This commit is contained in:
parent
e111d890ee
commit
8d299570e9
2 changed files with 20 additions and 0 deletions
18
liblrzip.c
18
liblrzip.c
|
|
@ -277,6 +277,15 @@ bool lrzip_file_del(Lrzip *lr, FILE *file)
|
|||
return true;
|
||||
}
|
||||
|
||||
FILE *lrzip_file_pop(Lrzip *lr)
|
||||
{
|
||||
FILE *ret;
|
||||
if ((!lr) || (!lr->infile_buckets)) return NULL;
|
||||
ret = lr->infiles[0];
|
||||
lrzip_file_del(lr, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void lrzip_files_clear(Lrzip *lr)
|
||||
{
|
||||
if ((!lr) || (!lr->infile_buckets)) return;
|
||||
|
|
@ -328,6 +337,15 @@ bool lrzip_filename_del(Lrzip *lr, const char *file)
|
|||
return true;
|
||||
}
|
||||
|
||||
const char *lrzip_filename_pop(Lrzip *lr)
|
||||
{
|
||||
static char buf[4096];
|
||||
if ((!lr) || (!lr->infilename_buckets)) return NULL;
|
||||
strcat(buf, lr->infilenames[0]);
|
||||
lrzip_filename_del(lr, buf);
|
||||
return &buf[0];
|
||||
}
|
||||
|
||||
void lrzip_filenames_clear(Lrzip *lr)
|
||||
{
|
||||
size_t x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue