I have a header file for what needs to be combined with C ++ and C API. Part C is wrapped in extern "C" , but the declarations themselves are very different from C; eg:
foo::Bar& Foo_Baz_GetBarOfQux(void *_self, const foo::Qux &qux);
Is there a way to use it in plain C form? I obviously can't use this header, but maybe I can redo it somehow:
Foo_Baz_GetBarOfQux(void*, const );
What puzzles me is how to declare the types of these links (if possible).
PS I know that I can write my own C-shell on top of this: I declare classes as opaque structures:
typedef struct foo_bar foo_bar_t; typedef struct foo_baz foo_baz_t; typedef struct foo_qux foo_qux_t;
and then write a C-like function that wraps the above function:
extern "C" foo_bar_t* foo_baz_get_bar_of_qux( foo_baz_t* baz, foo_qux_t* qux) { return (foo_bar_t*) Foo_Baz_GetBarOfQux(baz, *(foo::Qux*)qux); }
But I am wondering if I can directly use the original Foo_Baz_GetBarOfQux() .
source share