diff mpffs/common.c @ 31:3cca8070ef0f

mpffs-ls reports file sizes
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 30 Jun 2013 06:59:59 +0000
parents 9c3c5a572b57
children 9bc7f0e03fa8
line wrap: on
line diff
--- a/mpffs/common.c	Sun Jun 30 06:28:58 2013 +0000
+++ b/mpffs/common.c	Sun Jun 30 06:59:59 2013 +0000
@@ -311,6 +311,30 @@
 	exit(1);
 }
 
+size_head_chunk(ch, chi)
+	struct objinfo *ch;
+	struct chunkinfo *chi;
+{
+	chi->start = (u8 *) index((char *)ch->dataptr, '\0') + 1;
+	chi->end = find_end_of_chunk(ch);
+	if (chi->start >= chi->end) {
+		chi->len = 0;
+		return(0);
+	} else {
+		chi->len = chi->end - chi->start;
+		return(1);
+	}
+}
+
+size_extra_chunk(ch, chi)
+	struct objinfo *ch;
+	struct chunkinfo *chi;
+{
+	chi->start = ch->dataptr;
+	chi->end = find_end_of_chunk(ch);
+	chi->len = chi->end - chi->start;
+}
+
 find_root_node()
 {
 	struct objinfo obj;