MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / format_type

Function format_type

external/ggml/examples/python/stubs.py:24–34  ·  view source on GitHub ↗
(t: TypeDecl)

Source from the content-addressed store, hash-verified

22}
23
24def format_type(t: TypeDecl):
25 if isinstance(t, PtrDecl) or isinstance(t, Struct):
26 return 'ffi.CData'
27 if isinstance(t, Enum):
28 return 'int'
29 if isinstance(t, TypeDecl):
30 return format_type(t.type)
31 if isinstance(t, IdentifierType):
32 assert len(t.names) == 1, f'Expected a single name, got {t.names}'
33 return __c_type_to_python_type.get(t.names[0]) or 'ffi.CData'
34 return t.name
35
36class PythonStubFuncDeclVisitor(c_ast.NodeVisitor):
37 def __init__(self):

Callers 1

visit_FuncDeclMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected