Automatically Generate C Code From Header

后端 未结 3 1108
庸人自扰
庸人自扰 2021-02-15 19:01

I want to generate empty implementations of procedures defined in a header file. Ideally they should return NULL for pointers, 0 for integers, etc, and, in an ideal world, also

3条回答
  •  旧时难觅i
    2021-02-15 19:37

    Caveat: this is an unresearched answer as I haven't had any experience with it myself.

    I think you might have some luck with a mocking framework designed for unit testing. An example of such a framework is: cmock

    The project page suggests it will generate code from a header. You could then take the code and tweak it.

提交回复
热议问题