Slowly delving into coccinelle, I now find I have to use python for this...
I want to replace stralloc2() all along the code, but it depends on
the arguments - here, e1 and e2 are classical expressions, c1 and c2
are character constants:
stralloc2(e1, e2) --> g_strjoin(NULL, e1, e2, NULL)
stralloc("c1", e2) --> g_strdup_printf("c1%s", e2)
stralloc(e1, "c2") --> g_strdup_printf("%sc2", e1)
I already know that a char constant can be declared as:
constant char[] c1;
But in this particular case, I need to transform that constant... How
is it done? I don't know python at all :(
--
Francis Galiegue, [email protected]
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)