Skip to content

Using struct_layout for introspection #2

@yairlenga

Description

@yairlenga

I came across this plugin, while looking for way to implement introspection like functionality for large code. Found it very elegant/compact. Interested to know if there is any activity here/follow-up project. In particular, trying to see if possible to implement this in such a way that the generated output will be embedded into the code. Something like

struct foo_bar { ... } *p;

const char *my_desc = structureof(*p) // or structureof(struct foo_bar)
print_struct (my_desc, p) ;

Which will automatically include members.

Ideally, the generate string will be easily decoded in "C" program, leading to easy implementation of print_struct_struct, read_struct, .... Thinking forward, this can be used to implement ORM - automatically read from SQL select and populate data structure, and the other way around. For RDB, document DB's. ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions