]> git.draconx.ca Git - liblbx.git/commitdiff
liblbx: Rename lbx_stat to lbx_file_stat.
authorNick Bowler <nbowler@draconx.ca>
Thu, 11 Feb 2010 00:42:12 +0000 (19:42 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 11 Feb 2010 04:46:58 +0000 (23:46 -0500)
src/gui/lbxgui.c
src/lbx.c
src/lbx.h
src/lbxtool.c

index 429e59f42876afbe5dd748289ee1e7c633d81929..da03cfbcfc823ecd3754b57d346e442f39f83db4 100644 (file)
@@ -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,
index 5dc14fdc8fe597e56aa9376c6c6a0a5729124ed2..0e26315fc8652acdc922a7f526140d5288463ab9 100644 (file)
--- 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;
 }
 
index 29a4083982dcb549042abf04b4f2f388a976dbc0..3570803e4958c18284c45e8dd2bfc84d53a18430 100644 (file)
--- 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);
index 754592ff251c428ae24a57fdde9ea3e52c8644db..f393eaab3b43657364a51169a810637e53a76bc1 100644 (file)
@@ -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;