utils
AOT Handler Utilities API
The utils
module provides utility functions for AOT handlers.
Copyright 2025 Ambiq. All Rights Reserved.
Classes
Functions
generate_mermaid
sanitize_for_c_comment
Sanitize a string (or bytes) so it can safely live inside a C block comment (/ ... /).
Transforms: - If bytes/bytearray, decode as UTF-8 (replacing errors). - Replaces '/' with '/ ' and '/' with ' /' - Strips out non-printable/control chars except tab/newline/carriage-return.
Parameters:
Returns:
-
str
(str
) –Sanitized text.