Skip to content

Commit

Permalink
Return self on load for chaining (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Nov 24, 2023
1 parent 72b91af commit ffbf4f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dissect/cstruct/cstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def addtype(self, name: str, type_: BaseType, replace: bool = False) -> None:

self.typedefs[name] = type_

def load(self, definition: str, deftype: int = None, **kwargs) -> None:
def load(self, definition: str, deftype: int = None, **kwargs) -> "cstruct":
"""Parse structures from the given definitions using the given definition type.
Definitions can be parsed using different parsers. Currently, there's
Expand All @@ -212,6 +212,8 @@ def load(self, definition: str, deftype: int = None, **kwargs) -> None:
elif deftype == cstruct.DEF_LEGACY:
CStyleParser(self, **kwargs).parse(definition)

return self

def loadfile(self, path: str, deftype: int = None, **kwargs) -> None:
"""Load structure definitions from a file.
Expand Down

0 comments on commit ffbf4f8

Please sign in to comment.