Skip to content

mkapi: untangle types & typedefs #18

@jepler

Description

@jepler

Description

There's a lot of confusion in mkapi due to ad-hoc handling of C types (structures & typedefs).

Here's a plan to improve things:

Getting rid of the use of strings to carry C type information at all. Instead, introduce class Struct and class Scalar to go with class Ptr and class Array. An Argument object's type field would always be a Scalar, Struct, Ptr, or Array.

The return_ property of a function should similarly be a "C type object" (Struct/Scalar/Ptr/Array).

Add a single function that will look up the type information from a C type string for use in argument & return value handling, instead of smearing the 'check if it's a struct / check if it's a typedef' across the whole system.

This will make for some churn in mkapi, but overall it should simplify things.

Implementation

I intend to implement this feature and would submit a Pull Request if desirable

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions