summaryrefslogtreecommitdiff
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-09-11 18:43:16 -0400
committerNick Mathewson <nickm@torproject.org>2019-09-11 18:43:16 -0400
commit9a101c2c0f1e4598cd5bd2710e6021052e4ebdfa (patch)
tree3674a2fc0317a740fb7777af094a5db36a9b8bdb /scripts/coccinelle
parent41261c3b5cd505f5a601c319eb484866903814af (diff)
downloadtor-9a101c2c0f1e4598cd5bd2710e6021052e4ebdfa.tar.gz
tor-9a101c2c0f1e4598cd5bd2710e6021052e4ebdfa.zip
Add a script to run spatch with appropriate arguments
It's a bit tricky to remember the right incantation to get the proper include paths and incantations for coccinelle, but without it, coccinelle is less effective at parsing our C.
Diffstat (limited to 'scripts/coccinelle')
-rwxr-xr-xscripts/coccinelle/apply.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/coccinelle/apply.sh b/scripts/coccinelle/apply.sh
new file mode 100755
index 0000000000..82e773dc39
--- /dev/null
+++ b/scripts/coccinelle/apply.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# apply.sh:
+# run spatch with appropriate includes and builtins for the Tor source code
+
+top="$(dirname "$0")/../.."
+
+spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
+ -I "$top" -I "$top"/src -I "$top"/ext "$@"