Extract the fields of a C struct

后端 未结 7 725
盖世英雄少女心
盖世英雄少女心 2020-12-24 08:56

I often have to write code in other languages that interact with C structs. Most typically this involves writing Python code with the struct or ctypes modules.

So I

7条回答
  •  再見小時候
    2020-12-24 09:25

    ctypes-codegen or ctypeslib (same thing, I think) will generate ctypes Structure definitions (also other things, I believe, but I only tried structs) by parsing header files using GCCXML. It's no longer supported, but will likely work in some cases.

提交回复
热议问题