openbsd-ports/devel/coccigrep
sthen 6195f2b398 import ports/devel/coccigrep, ok jasper@
coccigrep is a semantic grep for the C language based on coccinelle.
It can be used to find where a given structure is used in code files.
coccigrep depends on the spatch program which comes with coccinelle.

quick contrived example to find lines referencing m_len of a struct
mbuf, regardless of actual variable name:

$ coccigrep -t "struct mbuf" -a m_len /sys/netinet/ip_*.c
2011-09-15 20:20:06 +00:00
..
patches
pkg
distinfo
Makefile