]> git.draconx.ca Git - liblbx.git/commitdiff
liblbx: Kill lbx_numfiles.
authorNick Bowler <draconx@users.sourceforge.net>
Sat, 14 May 2011 01:08:37 +0000 (21:08 -0400)
committerNick Bowler <draconx@users.sourceforge.net>
Sat, 14 May 2011 01:08:37 +0000 (21:08 -0400)
This function is now redundant.

src/gui/lbxgui.c
src/lbx.c
src/lbx.h
src/lbxtool.c

index 7eed44f6c825114e6c4bbfe426f256de24fcbd87..e230d6f84d862f84a95b28cd17bd4114507c2698 100644 (file)
@@ -331,8 +331,7 @@ static int load_archive(const char *path)
                -1);
        g_free(basename);
 
-       nfiles = lbx_numfiles(lbx);
-       for (unsigned i = 0; i < nfiles; i++) {
+       for (unsigned i = 0; i < lbx->nfiles; i++) {
                struct lbx_statbuf stat;
 
                lbx_file_stat(lbx, i, &stat);
index 1d92f469d9b8c357003f61c05c381969ab61ea5e..57a72b082e70158ff8abd6d2205f90cce4f13caa 100644 (file)
--- a/src/lbx.c
+++ b/src/lbx.c
@@ -182,13 +182,7 @@ struct lbx *lbx_fopen(const char *file)
        return lbx_open(p, &lbx_pipe_fops, pipe_close, name);
 }
 
-size_t lbx_numfiles(struct lbx *pub)
-{
-       return pub->nfiles;
-}
-
-int
-lbx_file_stat(struct lbx *pub, unsigned fileno, struct lbx_statbuf *buf)
+int lbx_file_stat(struct lbx *pub, unsigned fileno, struct lbx_statbuf *buf)
 {
        struct lbx_priv *lbx = (struct lbx_priv *)pub;
        static char str[256]; /* FIXME */
index a7be05876b2d8b5c0ea62717f60f8e5ae9976d17..0f09c06bcb3e3aec8f7a285be01f79dd180fd2d1 100644 (file)
--- a/src/lbx.h
+++ b/src/lbx.h
@@ -43,7 +43,6 @@ LBX   *lbx_open(void *handle, const struct lbx_file_ops *fops,
 LBX   *lbx_fopen(const char *);
 LBX   *lbx_mopen(void *, size_t, const char *);
 int    lbx_close(LBX *);
-size_t lbx_numfiles(LBX *);
 
 /* File operations */
 int      lbx_file_stat(LBX *lbx, unsigned fileno, struct lbx_statbuf *out);
index 9c4b57bbf623d6dafaa45f76084b964db07703d8..8a5a428d198fdb0bc949103e8cc8fd069b355976 100644 (file)
@@ -69,16 +69,15 @@ int filematch(char **argv, const char *name)
        return i ? -1: 0;
 }
 
-int list(LBX *lbx, int verbose, char **argv) {
-       size_t nfiles;
+int list(LBX *lbx, int verbose, char **argv)
+{
        unsigned int i;
 
-       nfiles = lbx_numfiles(lbx);
        if (verbose) {
-               printf("Files in archive: %zu\n", nfiles);
+               printf("Files in archive: %u\n", lbx->nfiles);
        }
 
-       for (i = 0; i < nfiles; i++) {
+       for (i = 0; i < lbx->nfiles; i++) {
                struct lbx_statbuf stat;
 
                lbx_file_stat(lbx, i, &stat);
@@ -143,16 +142,15 @@ int extract_file(LBXfile *f, const struct lbx_statbuf *stat)
        return ret;
 }
 
-int extract(LBX *lbx, int verbose, char **argv) {
-       size_t nfiles;
+int extract(LBX *lbx, int verbose, char **argv)
+{
        unsigned int i;
 
-       nfiles = lbx_numfiles(lbx);
        if (verbose) {
-               printf("Files in archive: %zu\n", nfiles);
+               printf("Files in archive: %u\n", lbx->nfiles);
        }
 
-       for (i = 0; i < nfiles; i++) {
+       for (i = 0; i < lbx->nfiles; i++) {
                struct lbx_statbuf stat;
                LBXfile *file;