for (unsigned i = 0; i < nfiles; i++) {
struct lbx_statbuf stat;
- lbx_stat(lbx, i, &stat);
+ lbx_file_stat(lbx, i, &stat);
gtk_tree_store_append(archives, &iter2, &iter1);
gtk_tree_store_set(archives, &iter2,
0, stat.name,
return lbx->nfiles;
}
-int lbx_stat(struct lbx_state *lbx, size_t index, struct lbx_statbuf *buf)
+int
+lbx_file_stat(struct lbx_state *lbx, unsigned fileno, struct lbx_statbuf *buf)
{
static char str[256]; /* FIXME */
- if (index >= lbx->nfiles) {
+ if (fileno >= lbx->nfiles) {
buf->name = NULL;
lbx_errno = LBX_ERANGE;
return -1;
}
- snprintf(str, sizeof str, "%s.%03zu", lbx->name, index);
+ snprintf(str, sizeof str, "%s.%03u", lbx->name, fileno);
buf->name = str;
- buf->size = lbx->offsets[index+1] - lbx->offsets[index];
+ buf->size = lbx->offsets[fileno+1] - lbx->offsets[fileno];
return 0;
}
size_t lbx_numfiles(LBX *);
/* File operations */
-int lbx_stat(LBX *, size_t, struct lbx_statbuf *);
-
+int lbx_file_stat(LBX *lbx, unsigned fileno, struct lbx_statbuf *out);
LBXfile *lbx_file_open(LBX *lbx, unsigned fileno);
size_t lbx_file_read(LBXfile *f, void *buf, size_t n);
int lbx_file_seek(LBXfile *f, long offset, int whence);
for (i = 0; i < nfiles; i++) {
struct lbx_statbuf stat;
- lbx_stat(lbx, i, &stat);
+ lbx_file_stat(lbx, i, &stat);
switch (filematch(argv, stat.name)) {
case -1: continue;
struct lbx_statbuf stat;
LBXfile *file;
- lbx_stat(lbx, i, &stat);
+ lbx_file_stat(lbx, i, &stat);
switch (filematch(argv, stat.name)) {
case -1: continue;