Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions python/binaryview.py
Original file line number Diff line number Diff line change
Expand Up @@ -7810,18 +7810,18 @@ def parse_type_string(self, text: str, import_dependencies: bool = True) -> Tupl
finally:
core.BNFreeQualifiedNameAndType(result)

def parse_types_from_string(self, text: str, options: Optional[List[str]] = None, include_dirs: Optional[List[str]] = None, import_dependencies: bool = True) -> '_types.TypeParserResult':
def parse_types_from_string(self, text: str, options: Optional[List[str]] = None, include_dirs: Optional[List[str]] = None, import_dependencies: bool = True) -> '_types.BasicTypeParserResult':
"""
``parse_types_from_string`` parses string containing C into a :py:class:`TypeParserResult` objects. This API
``parse_types_from_string`` parses string containing C into a :py:class:`BasicTypeParserResult` objects. This API
unlike the :py:func:`~binaryninja.platform.Platform.parse_types_from_source` allows the reference of types already defined
in the BinaryView.

:param str text: C source code string of types, variables, and function types, to create
:param options: Optional list of string options to be passed into the type parser
:param include_dirs: Optional list of header search directories
:param import_dependencies: If Type Library types should be imported during parsing
:return: :py:class:`~binaryninja.typeparser.TypeParserResult` (a SyntaxError is thrown on parse error)
:rtype: TypeParserResult
:return: :py:class:`~binaryninja.typeparser.BasicTypeParserResult` (a SyntaxError is thrown on parse error)
:rtype: BasicTypeParserResult
:Example:

>>> bv.parse_types_from_string('int foo;\\nint bar(int x);\\nstruct bas{int x,y;};\\n')
Expand Down Expand Up @@ -7876,7 +7876,7 @@ def parse_types_from_string(self, text: str, options: Optional[List[str]] = None
functions[name] = _types.Type.create(
core.BNNewTypeReference(parse.functions[i].type), platform=self.platform
)
return _types.TypeParserResult(type_dict, variables, functions)
return _types.BasicTypeParserResult(type_dict, variables, functions)
finally:
core.BNFreeTypeParserResult(parse)

Expand Down
1 change: 1 addition & 0 deletions python/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
TypeContainerType = Union['binaryview.BinaryView', 'typelibrary.TypeLibrary']
NameSpaceType = Optional[Union[str, List[str], 'NameSpace']]
TypeParserResult = typeparser.TypeParserResult
BasicTypeParserResult = typeparser.BasicTypeParserResult
ResolveMemberCallback = Callable[['NamedTypeReferenceType', 'StructureType', int, int, int, 'StructureMember'], None]
# The following are needed to prevent the type checker from getting
# confused as we have member functions in `Type` named the same thing
Expand Down
Loading