update x86_64 abi, use ptr arg too so qualifier diffs are catched
[musl-tools.git] / tab_types.sh
blob10869126171c32f4a0cd43c85d7890d7693aab3b
1 #!/bin/sh
3 export LC_ALL=C
5 awk -F'\t' '
6 ($3=="t"||$3=="s") && ($2~/^include/ || $2~/^arch.*bits/) && $1!~/^__/ && $1!~/ __/ {
7 print $1
8 }' data/musl.inc.tags |sort -u |awk '
9 function gfmt(s) {
10 if (s ~ /^ *$/)
11 return ""
12 s0 = s
13 sub(/:/, "#l", s)
14 return "<a href=\"http://sourceware.org/git/?p=glibc.git;a=blob;f=" s "\">" s0 "</a><br>"
16 function mfmt(s) {
17 if (s ~ /^ *$/)
18 return ""
19 s0 = s
20 sub(/:/, "#n", s)
21 return "<a href=\"http://git.musl-libc.org/cgit/musl/tree/" s "\">" s0 "</a><br>"
23 function ga(s) {
24 n = split(s, a, / /)
25 r = ""
26 for (i = 1; i <= n; i++)
27 r = r " " gfmt(a[i])
28 return r
30 function ma(s) {
31 n = split(s, a, / /)
32 r = ""
33 for (i = 1; i <= n; i++)
34 r = r " " mfmt(a[i])
35 return r
37 function pinc(s) {
38 n = split(s, a, / /)
39 for (i = 1; i <= n; i++) {
40 sub(/:.*/,"",a[i])
41 sub(/include\//,"",a[i])
42 sub(/arch.*bits\//,"",a[i])
43 h0 = a[i]
44 if (a[i] in pmap) {
45 gsub(/\//,"_",a[i])
46 return "<a href=\"http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/" a[i] ".html\">" h0 "</a>"
49 return ""
51 BEGIN {
52 FS = "\t"
54 posix = "data/posix2008.inc"
55 g = "data/glibc.inc.tags"
56 m = "data/musl.inc.tags"
58 while (getline < posix == 1)
59 pmap[$1] = 1
60 while (getline < g == 1)
61 # if ($3=="t" || $3=="s")
62 gmap[$1] = gmap[$1] " " $2 ":" $4
63 while (getline < m == 1)
64 if (($3=="t" || $3=="s") && $2 !~ /^src\//)
65 mmap[$1] = mmap[$1] " " $2 ":" $4
67 print "<h3>types</h3>"
68 print "<h4>table</h4><table border=1><tr><th>name<th>posix<th>musl<th>glibc"
71 while (getline == 1) {
72 print "<tr><td>" $1 "<td>" pinc(mmap[$1]) "<td>" ma(mmap[$1]) "<td>" ga(gmap[$1])
73 # s = s "<td><a href=\"http://pubs.opengroup.org/onlinepubs/9699919799/functions/" $1 ".html\">" $1 "</a>"
74 # s = s " <a href=\"http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/" h ".html\">" x[i] "</a>"
76 print "</table>"
77 }' >tab_types.html