code_wrapper: Doc-string fixes.

Signed-off-by: Minos Galanakis <[email protected]>
This commit is contained in:
Minos Galanakis
2024-07-05 09:49:55 +01:00
parent 425fb3b807
commit 8eb02d1c34
2 changed files with 9 additions and 8 deletions
@@ -67,7 +67,6 @@ class Base:
This includes a description comment and some include directives.
"""
prologue = textwrap.dedent("""
/* Automatically generated by generate_psa_wrappers.py, do not edit! */
@@ -98,8 +97,7 @@ class Base:
out.write(prologue)
def _write_epilogue(self, out: typing_util.Writable, header: bool) -> None:
"""Write the epilogue of a C file.
"""
"""Write the epilogue of a C file."""
epilogue = ""
if header:
epilogue += textwrap.dedent("""
@@ -100,10 +100,10 @@ class PSAWrapper(c_wrapper_generator.Base):
c_parsing_helper.read_function_declarations(self.functions, header_path)
def rel_path(self, filename: str, path_list: List[str] = ['include', 'psa']) -> str:
""" Return the estimated path in relationship to the.
mbedtls_root. The method allows overriding the targetted sub-directory.
Currently the default is set to mbedtls_root/include/psa """
"""Return the estimated path in relationship to the mbedtls_root.
The method allows overriding the targetted sub-directory.
Currently the default is set to mbedtls_root/include/psa."""
# Temporary, while Mbed TLS does not just rely on the TF-PSA-Crypto
# build system to build its crypto library. When it does, the first
# case can just be removed.
@@ -116,8 +116,10 @@ class PSAWrapper(c_wrapper_generator.Base):
# Utility Methods
@staticmethod
def parse_def_guards(def_list: Collection[str])-> str:
""" Parse an input list of format [[[C] preprocessor] macro, ...] and generate a
c compatible defined() && !defined() syntax string"""
""" Create define guards.
Parses an input list of format [[[C] preprocessor] macro, ...] and
generates a c compatible defined() && !defined() syntax string."""
output = ""
dl = [("defined({})".format(n) if n[0] != "!" else
@@ -170,6 +172,7 @@ class PSAWrapper(c_wrapper_generator.Base):
buffer_parameters: List['BufferParameter'],
poison: bool) -> None:
"""Write poisoning or unpoisoning code for the buffer parameters.
Write poisoning code if poison is true, unpoisoning code otherwise.
"""