table of contents
SPATCH(1) | General Commands Manual | SPATCH(1) |
NAME¶
spatch - apply a semantic patch file to a set of C filesSYNOPSIS¶
spatch -sp_file <SP> <files> [-o <outfile> ] [-iso_file <iso> ] [ options ]DESCRIPTION¶
spatch is a program matching and transformation tool for C. The programmer describes the code to match and the transformation to perform as a semantic patch, which looks like a standard patch, but can transform multiple files at any number of code sites.OPTIONS¶
Here is a summary of the most commonly used options:- -sp_file <file>
- the semantic patch file
- -dir <dir>
- process all files in directory recursively
- -iso_file <file>
- (default=/usr/share/coccinelle/standard.iso)
- -macro_file <file>
- (default=/usr/share/coccinelle/standard.h)
- -debug
- print some information to help debug the matching process
- -all_includes
- causes all available include files to be used
- -no_includes
- causes not even local include files to be used
- -I <dir>
- the directory containing the include files
- -include_headers
- process header files independently
- -use_glimpse
- works with -dir, use information generated by glimpseindex
- -o <file>
- the output file. If none is specified, a patch is generated on the standard output
- -in_place
- do the modification on the file directly
- -out_place
- store modifications in a .cocci_res file
- -version
- show the version of spatch
- -date
- show the date on which spatch was compiled
- -shorthelp
- see short list of options
- -longhelp
- see all the available options in different categories
- -help, --help
- show summary of options.
EXAMPLES¶
./spatch -sp_file foo.cocci foo.c
./spatch -sp_file foo.cocci foo.c -o /tmp/newfoo.c
./spatch -cocci_file foo.cocci -dir foodir
FILES¶
/usr/share/coccinelle/standard.isoThis file contains the default set of
isomorphisms.
/usr/share/coccinelle/standard.h
This file contains the default set of macro
hints.
ENVIRONMENT¶
- COCCINELLE_HOME
- The path to the Coccinelle share directory. Default is
/usr/share/coccinelle
REFERENCES¶
Y. Padioleau, J.L. Lawall, R.R Hansen, G. Muller "Documenting and Automating Collateral Evolutions in Linux Device Driver" EuroSys 2008, Glasgow, Scotland (April 2008) pp. 247-260.AUTHOR¶
spatch was written by Julia Lawall <julia@diku.dk>, Yoann Padioleau <yoann.padioleau@gmail.com>, Rene Rydhof Hansen <rrhansen@diku.dk> and Henrik Stuart <henrik@hstuart.dk>. This manual page was written by Yoann Padioleau <yoann.padioleau@gmail.com> and Julia Lawall <julia@diku.dk>.REPORTING BUGS¶
Send a mail to <cocci@diku.dk>COPYRIGHT¶
Copyright 2010, 2011, University of Copenhagen DIKU and INRIA. Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen. spatch is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, according to version 2 of the License.SEE ALSO¶
patch(1), diff(1)May 17, 2011 |