I would like to implement some kind of name mangling for a C interface. I will have functions and types like
struct Foo;
struct Foo* Foo_create(struct Bar* bar);
void Foo_destroy(struct Foo* obj);
struct Foo_InnerClass;
...
Now, the _ is used extensivliy in all standard c typedefs, so the scheme would not work good if these typedefs are used. GCC and MSVC seems to accept names using $. Would that work? Are there any other acceptet characters that I can use?
EDIT:
I want to do this because
- It avoids duplicated names
- It emphases what class an identifier belongs to
- It makes it possible to automatically generate C++ interface
EDIT 2:
Reserve an ordinary letter will compile everywhere, but it can also be confusing:
struct Foo* FooIcreate(struct Bar* bar);
EDIT 3:
The symbol may differ depending on target platform, but on that platform, it must not collide with C++ name mangling.
EDIT 4:
It is forbidden to begin an identifier with a digit. So what about:
struct Foo* Foo_1_create(struct Bar* bar);