summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
-rw-r--r--src/ustar.c3
-rw-r--r--src/ustar.h5
3 files changed, 7 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index d400934..8daefc6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -152,7 +152,7 @@ _opkg_opk_main_list_members(struct opkg_opk_ustar *ustar)
int ret;
while ((ret = opkg_opk_ustar_list(ustar, &member)) == OPKG_OPK_OK) {
- puts(member.name);
+ printf("%11d %s\n", member.size, member.name);
}
if (ret == OPKG_OPK_ERROR) {
fputs("Error: Failed to list data files\n", stderr);
diff --git a/src/ustar.c b/src/ustar.c
index d728cf5..a4395f4 100644
--- a/src/ustar.c
+++ b/src/ustar.c
@@ -50,7 +50,7 @@ struct _opkg_opk_ustar_header {
struct opkg_opk_ustar {
struct opkg_opk_gzip *gzip;
- int32_t data_size_remaining;
+ int64_t data_size_remaining;
unsigned char read_record[OPKG_OPK_USTAR_RECORD_SIZE];
};
@@ -118,6 +118,7 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar,
memcpy(member->name, header.name, sizeof(header.name));
member->name[sizeof(header.name)] = '\0';
}
+ member->size = ustar->data_size_remaining;
while (ustar->data_size_remaining > 0) {
if (opkg_opk_ustar_read(ustar, NULL, NULL) == OPKG_OPK_ERROR) {
diff --git a/src/ustar.h b/src/ustar.h
index de782b8..4015639 100644
--- a/src/ustar.h
+++ b/src/ustar.h
@@ -20,6 +20,8 @@
#ifndef OPKG_OPK_USTAR_H_
#define OPKG_OPK_USTAR_H_
+#include <stdint.h>
+
#define OPKG_OPK_USTAR_RECORD_SIZE 512
#define OPKG_OPK_USTAR_NAME_MAX_LEN 257 /* prefix[155] + '/' + name[100] + '\0'
*/
@@ -27,7 +29,8 @@
struct opkg_opk_ustar;
struct opkg_opk_ustar_member {
- char name[OPKG_OPK_USTAR_NAME_MAX_LEN];
+ char name[OPKG_OPK_USTAR_NAME_MAX_LEN];
+ int64_t size;
};
struct opkg_opk_ustar *