From c02dcc9610e66ebe6154e60dcd2f109c90eb09df Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 10 Feb 2010 19:42:12 -0500 Subject: [PATCH] liblbx: Rename lbx_stat to lbx_file_stat. --- src/gui/lbxgui.c | 2 +- src/lbx.c | 9 +++++---- src/lbx.h | 3 +-- src/lbxtool.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/lbxgui.c b/src/gui/lbxgui.c index 429e59f..da03cfb 100644 --- a/src/gui/lbxgui.c +++ b/src/gui/lbxgui.c @@ -333,7 +333,7 @@ static int load_archive(const char *path) 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, diff --git a/src/lbx.c b/src/lbx.c index 5dc14fd..0e26315 100644 --- a/src/lbx.c +++ b/src/lbx.c @@ -190,19 +190,20 @@ size_t lbx_numfiles(struct lbx_state *lbx) 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; } diff --git a/src/lbx.h b/src/lbx.h index 29a4083..3570803 100644 --- a/src/lbx.h +++ b/src/lbx.h @@ -52,8 +52,7 @@ int lbx_close(LBX *); 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); diff --git a/src/lbxtool.c b/src/lbxtool.c index 754592f..f393eaa 100644 --- a/src/lbxtool.c +++ b/src/lbxtool.c @@ -81,7 +81,7 @@ int list(LBX *lbx, int verbose, char **argv) { 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; @@ -156,7 +156,7 @@ int extract(LBX *lbx, int verbose, char **argv) { 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; -- 2.43.0