2023-08-02 14:38:38 +00:00
|
|
|
## vim: filetype=makopython
|
|
|
|
|
|
|
|
|
|
def set_config_pragmas_mapping(
|
|
|
|
|
self,
|
2025-11-18 10:30:40 +00:00
|
|
|
global_pragmas: Opt[AnyStr] = None,
|
|
|
|
|
local_pragmas: Opt[Dict[AnyStr, AnyStr]] = None,
|
2023-08-02 14:38:38 +00:00
|
|
|
):
|
|
|
|
|
${py_doc("libadalang.set_config_pragmas_mapping", 8)}
|
|
|
|
|
|
2025-11-18 10:30:40 +00:00
|
|
|
global_c = _unwrap_filename(global_pragmas)
|
2023-08-02 14:38:38 +00:00
|
|
|
|
|
|
|
|
local_mapping = []
|
|
|
|
|
if local_pragmas is not None:
|
|
|
|
|
for key, value in local_pragmas.items():
|
2025-11-18 10:30:40 +00:00
|
|
|
local_mapping += [
|
|
|
|
|
_unwrap_filename(key), _unwrap_filename(value)
|
|
|
|
|
]
|
2023-08-02 14:38:38 +00:00
|
|
|
local_mapping.append(None)
|
|
|
|
|
|
2025-11-18 10:30:40 +00:00
|
|
|
local_c_type = ctypes.c_char_p * len(local_mapping)
|
2023-08-02 14:38:38 +00:00
|
|
|
local_c = local_c_type()
|
|
|
|
|
for i, u in enumerate(local_mapping):
|
|
|
|
|
local_c[i] = u
|
|
|
|
|
|
|
|
|
|
_set_config_pragmas_mapping(self._c_value, global_c, local_c)
|
2024-10-08 14:25:45 +00:00
|
|
|
|
|
|
|
|
def set_target_information(self, target_info: TargetInformation) -> None:
|
|
|
|
|
${py_doc("libadalang.target_info_set", 8)}
|
|
|
|
|
assert isinstance(target_info, TargetInformation)
|
|
|
|
|
TargetInformation._c_set(self._c_value, target_info._c_value)
|