coccinelle

Coccinelle is a tool to utilize semantic patches for manipulating C code. It was originally designed to ease maintenance of device drivers in the Linux kernel.