On Mon, 1 Dec 2014, Francois Berenger wrote: > Hello, > > Inside of applying any patch, I need to use coccinelle > in order to detect certain C files that match a given pattern > in a source code tree. > > Is it possible to use coccinelle for that, how?
Yes. One way is to put * on the lines of interest, in place of - or +. Then you will get a diff in which the matched lines of interest are marked with -. With emacs diff mode, you can jump from the diff to the context in the source file. Another way is to use position variables and use ocaml or python to print a message indicating wher you found whatever is of interest. You can find many examples of both uses in the examples in the Linux kernel source tree, in the scripts/coccinelle subdirectory. julia > > -- > Regards, > Francois. > _______________________________________________ > Cocci mailing list > [email protected] > https://systeme.lip6.fr/mailman/listinfo/cocci > _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
