I have some existing code that uses an enum instead of a function pointer for callbacks. The callback is called using a table: callback_table[enum].
The enums are named with an enum_ prefix and the corresponding function is named with a func_ prefix.
So, function calls involving callbacks look like this:
foo (param, enum_name);
While browsing code I have to take the name part and prefix func_ instead of just doing a "Jump to definition".
I would like to have a macro so that my code looks like this:
foo (param, f2e(func_name));
so that I can keep the existing code unchanged and still be able to do a "Jump to definition".
Is it possible to have such a macro? The simplest solution would be to omit func_ which means that f2e simple attaches the enum_ prefix, but I would prefer a solution where I can still have func_. Is this possible?