sailfish.kernel.parse_api.parse_api

sailfish.kernel.parse_api.parse_api(code)[source]

Parse a C-like source file to extract a public API.

The C code needs to conform to a set of conventions, which still need to be fully documented. This function returns a dictionary whose keys are the names of the public functions (or kernels) in the code, and the values are lists of the (positional) arguments describing the function signature. Each function argument is a tuple of the data type, the argument name, and an optional constraint which could be validated at runtime.