| 16 | |
| 17 | |
| 18 | class CRenderData: |
| 19 | def __init__(self) -> None: |
| 20 | |
| 21 | # The C statements to declare variables. |
| 22 | # Should be full lines with \n eol characters. |
| 23 | self.declarations: list[str] = [] |
| 24 | |
| 25 | # The C statements required to initialize the variables before the parse call. |
| 26 | # Should be full lines with \n eol characters. |
| 27 | self.initializers: list[str] = [] |
| 28 | |
| 29 | # The C statements needed to dynamically modify the values |
| 30 | # parsed by the parse call, before calling the impl. |
| 31 | self.modifications: list[str] = [] |
| 32 | |
| 33 | # The entries for the "keywords" array for PyArg_ParseTuple. |
| 34 | # Should be individual strings representing the names. |
| 35 | self.keywords: list[str] = [] |
| 36 | |
| 37 | # The "format units" for PyArg_ParseTuple. |
| 38 | # Should be individual strings that will get |
| 39 | self.format_units: list[str] = [] |
| 40 | |
| 41 | # The varargs arguments for PyArg_ParseTuple. |
| 42 | self.parse_arguments: list[str] = [] |
| 43 | |
| 44 | # The parameter declarations for the impl function. |
| 45 | self.impl_parameters: list[str] = [] |
| 46 | |
| 47 | # The arguments to the impl function at the time it's called. |
| 48 | self.impl_arguments: list[str] = [] |
| 49 | |
| 50 | # For return converters: the name of the variable that |
| 51 | # should receive the value returned by the impl. |
| 52 | self.return_value = "return_value" |
| 53 | |
| 54 | # For return converters: the code to convert the return |
| 55 | # value from the parse function. This is also where |
| 56 | # you should check the _return_value for errors, and |
| 57 | # "goto exit" if there are any. |
| 58 | self.return_conversion: list[str] = [] |
| 59 | self.converter_retval = "_return_value" |
| 60 | |
| 61 | # The C statements required to do some operations |
| 62 | # after the end of parsing but before cleaning up. |
| 63 | # These operations may be, for example, memory deallocations which |
| 64 | # can only be done without any error happening during argument parsing. |
| 65 | self.post_parsing: list[str] = [] |
| 66 | |
| 67 | # The C statements required to clean up after the impl call. |
| 68 | self.cleanup: list[str] = [] |
| 69 | |
| 70 | # The C statements to generate critical sections (per-object locking). |
| 71 | self.lock: list[str] = [] |
| 72 | self.unlock: list[str] = [] |
| 73 | |
| 74 | |
| 75 | @dc.dataclass(slots=True, frozen=True) |
no outgoing calls
no test coverage detected
searching dependent graphs…