mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-06 16:40:05 +01:00
add queue popping functions
This commit is contained in:
parent
e111d890ee
commit
8d299570e9
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;
|
||||
|
|
|
|||
|
|
@ -87,9 +87,11 @@ FILE **lrzip_files_get(Lrzip *lr);
|
|||
char **lrzip_filenames_get(Lrzip *lr);
|
||||
bool lrzip_file_add(Lrzip *lr, FILE *file);
|
||||
bool lrzip_file_del(Lrzip *lr, FILE *file);
|
||||
FILE *lrzip_file_pop(Lrzip *lr);
|
||||
void lrzip_files_clear(Lrzip *lr);
|
||||
bool lrzip_filename_add(Lrzip *lr, const char *file);
|
||||
bool lrzip_filename_del(Lrzip *lr, const char *file);
|
||||
const char *lrzip_filename_pop(Lrzip *lr);
|
||||
void lrzip_filenames_clear(Lrzip *lr);
|
||||
void lrzip_suffix_set(Lrzip *lr, const char *suffix);
|
||||
const char *lrzip_suffix_get(Lrzip *lr);
|
||||
|
|
|
|||
Loading…
Reference in a new issue