aboutsummaryrefslogtreecommitdiff
path: root/src/zebra.c
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-09-24 17:30:59 -0500
committertlatorre <tlatorre@uchicago.edu>2019-09-24 17:30:59 -0500
commit77b629ef03eb3154b47999847276e72447d22282 (patch)
tree10434236fd8a8386e43214f19694ca341acf4ae4 /src/zebra.c
parent1e35deac8fc248cb9a2a25e383604fd433480720 (diff)
downloadsddm-77b629ef03eb3154b47999847276e72447d22282.tar.gz
sddm-77b629ef03eb3154b47999847276e72447d22282.tar.bz2
sddm-77b629ef03eb3154b47999847276e72447d22282.zip
update zebra code to store location of MAST bank
This commit updates the zebra code to store a pointer to the first MAST bank in the zebraFile struct so that we can jump to it when iterating over the logical records. I had naively assumed based on the documenation in the SNOMAN companion that the first bank in a logical record was guaranteed to be a MAST bank, but that doesn't seem to be the case. This also explains why I was sometimes seeing RHDR and ZDAB banks as the first bank in a logical record.
Diffstat (limited to 'src/zebra.c')
-rw-r--r--src/zebra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zebra.c b/src/zebra.c
index a3a068f..5e02310 100644
--- a/src/zebra.c
+++ b/src/zebra.c
@@ -187,6 +187,7 @@ static int rewrite_links(zebraFile *z)
offset = z->lr_offset*4;
+ z->mast_bank = -1;
while (offset < z->lr_size) {
io = unpacki32(z->buf+offset);
offset += 4;
@@ -199,6 +200,12 @@ static int rewrite_links(zebraFile *z)
rv = zebra_get_bank(z, &b, offset/4);
+ if (!strncmp(b.name,"MAST",4)) {
+ if (z->mast_bank != -1)
+ fprintf(stderr, "Warning: found more than one MAST bank in a single logical record!\n");
+ z->mast_bank = offset/4;
+ }
+
if (rv) return rv;
/* Rewrite the next, up, and orig pointers. */