Timur Tabi
2018-11-15 20:58:03 UTC
Is it possible for a Python code snippet to be passed the name of the
current function? I already have Python code in my .cocci file that
cleans up the text of some string literals. I want to add more code
that removes the current function name from the beginning of a string
literal. So for instance, If I have
void myfunc(void)
{
...
NV_PRINTF("myfunc: xxx\n");
I want to replace the NV_PRINTF line with:
NV_PRINTF("xxx\n");
To do that, the Python code would need to given "myfunc" as a
parameter of some kind.
current function? I already have Python code in my .cocci file that
cleans up the text of some string literals. I want to add more code
that removes the current function name from the beginning of a string
literal. So for instance, If I have
void myfunc(void)
{
...
NV_PRINTF("myfunc: xxx\n");
I want to replace the NV_PRINTF line with:
NV_PRINTF("xxx\n");
To do that, the Python code would need to given "myfunc" as a
parameter of some kind.