summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
81d9da9)
This function is now redundant.
- 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);
struct lbx_statbuf stat;
lbx_file_stat(lbx, i, &stat);
return lbx_open(p, &lbx_pipe_fops, pipe_close, name);
}
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 */
{
struct lbx_priv *lbx = (struct lbx_priv *)pub;
static char str[256]; /* FIXME */
LBX *lbx_fopen(const char *);
LBX *lbx_mopen(void *, size_t, const char *);
int lbx_close(LBX *);
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);
/* File operations */
int lbx_file_stat(LBX *lbx, unsigned fileno, struct lbx_statbuf *out);
-int list(LBX *lbx, int verbose, char **argv) {
- size_t nfiles;
+int list(LBX *lbx, int verbose, char **argv)
+{
- nfiles = lbx_numfiles(lbx);
- 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);
struct lbx_statbuf stat;
lbx_file_stat(lbx, i, &stat);
-int extract(LBX *lbx, int verbose, char **argv) {
- size_t nfiles;
+int extract(LBX *lbx, int verbose, char **argv)
+{
- nfiles = lbx_numfiles(lbx);
- 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;
struct lbx_statbuf stat;
LBXfile *file;