summaryrefslogtreecommitdiff
path: root/tools/notsd-find-includes
diff options
context:
space:
mode:
Diffstat (limited to 'tools/notsd-find-includes')
-rwxr-xr-xtools/notsd-find-includes70
1 files changed, 35 insertions, 35 deletions
diff --git a/tools/notsd-find-includes b/tools/notsd-find-includes
index 6dfb406fa3..494398b082 100755
--- a/tools/notsd-find-includes
+++ b/tools/notsd-find-includes
@@ -3,50 +3,50 @@
phase=phase0
phase0() {
- phase=phase0
- local line="$1"
- case "$line" in
- '#include'*|'typedef '*';')
- phase1 "$line"
- ;;
- *)
- ;;
- esac
+ phase=phase0
+ local line="$1"
+ case "$line" in
+ '#include'*|'typedef '*';')
+ phase1 "$line"
+ ;;
+ *)
+ ;;
+ esac
}
phase1() {
- phase=phase1
- local line="$1"
- case "$line" in
- '')
- ;;
- '#include'*)
- ;;
- 'typedef '*';')
- ;;
- *)
- phase2 "$line"
- ;;
- esac
+ phase=phase1
+ local line="$1"
+ case "$line" in
+ '')
+ ;;
+ '#include'*)
+ ;;
+ 'typedef '*';')
+ ;;
+ *)
+ phase2 "$line"
+ ;;
+ esac
}
phase2() {
- phase=phase2
- local line="$1"
- printf '%s\n' "$line"
- cat
+ phase=phase2
+ local line="$1"
+ printf '%s\n' "$line"
+ cat
}
main() {
- current_file="$1"
- set -o pipefail
- {
- IFS=''
- while read -r line; do
- "$phase" "$line"
- IFS=''
- done
- } < "$current_file" | grep '^#include' | ifne printf '%s\n' "$current_file"
+ current_file="$1"
+ set -o pipefail
+ {
+ IFS=''
+ while read -r line; do
+ "$phase" "$line"
+ IFS=''
+ done
+ } < "$current_file" | grep '^#include' | ifne printf '%s\n' "$current_file"
}
main "$@"