summaryrefslogtreecommitdiffstats
path: root/lib/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tar.c')
-rw-r--r--lib/tar.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tar.c b/lib/tar.c
new file mode 100644
index 0000000..58b94b4
--- /dev/null
+++ b/lib/tar.c
@@ -0,0 +1,16 @@
+#include "tar.h"
+
+const char*
+tar_filename(struct tar_header *file)
+{
+ return file->filename;
+}
+
+int
+tar_filesize(struct tar_header *file)
+{
+ int r = 0;
+ const char *oct = file->size;
+ for(; *oct; oct++) r = (r * 8) + (*oct - '0');
+ return r;
+}