add queue popping functions

This commit is contained in:
discomfitor 2011-08-16 19:04:25 -04:00 committed by Con Kolivas
parent e111d890ee
commit 8d299570e9
2 changed files with 20 additions and 0 deletions

View file

@ -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;