def createFields(self): yield UInt32(self, "last_block") yield UInt32(self, "count") if self['last_block'].value != 0: for i in xrange(self['count'].value): block = UInt32(self, "child_block[]") yield block link = Link(self, "child_link[]") link.createValue = self.linkValue(block) yield link yield DSRecord(self, "record[]") link = Link(self, "child_link[]") link.createValue = self.linkValue(self['last_block']) yield link else: for i in xrange(self['count'].value): yield DSRecord(self, "record[]") if self.current_size < self.size: yield PaddingBytes(self, "slack", (self.size - self.current_size) // 8, description="slack space")
def createValue(self): field = InodeGen(self["/"], self.parent, self._getTargetPath())(self) if field: self._display = field.path return Link.createValue(self)
def __init__(self, parent, name, target=None): Link.__init__(self, parent, name) self.target = target self.first = None