fix posix headers (sys/, arpa/,..)
[musl-tables] / maketags.sh
1 #!/bin/sh
2
3 export LC_ALL=C
4 MUSL=${MUSL:-../musl}
5
6 (
7         cd $MUSL/include
8         ctags -f /tmp/musl.tags -R -n -u --language-force=c --c-kinds=pxdstuv --fields=k --exclude='*.sh' .
9 )
10
11 awk '
12 BEGIN {
13         FS="\t"
14 }
15 /^[^!]/ {
16         gsub(/[^0-9]*/,"",$3)
17         if ($4 == "s")
18                 $1 = "struct " $1
19         if ($4 == "u")
20                 $1 = "union " $1
21         print $1 "\t" $2 "\t" $4 "\t" $3
22 }' /tmp/musl.tags |sort >data/musl.tags
23 rm -f /tmp/musl.tags