cbindgen icon indicating copy to clipboard operation
cbindgen copied to clipboard

Support outputting forward declarations

Open emilio opened this issue 5 years ago • 2 comments

Cbindgen headers can get big. It may make sense to allow outputting a forward-declaration version of the header that declares the relevant types, though I haven't dug into how much effort it'd require.

emilio avatar Nov 10 '20 17:11 emilio

Would this cover the case where I'd want to expose a struct only by pointer? E.g., I currently manually write:

struct sqlpe_state_machine;
int sqlpe_spsm_create(struct sqlpe_state_machine **spsm_ptr);
int sqlpe_spsm_free(struct sqlpe_state_machine *spsm_ptr);

If you'd consider that a separate idea, I'd gladly open a new issue.

rubdos avatar Sep 28 '22 15:09 rubdos

That should already work afaict.

emilio avatar Sep 29 '22 07:09 emilio