]> git.cworth.org Git - apitrace/blob - specs/scripts/reference-opengl-arb.sh
Move all API specs to a separate dir.
[apitrace] / specs / scripts / reference-opengl-arb.sh
1 #!/bin/sh
2 # Script to extract reference URLs for functions documented in OpenGL ARB specs
3
4 extract_urls () {
5     for URL
6     do
7             lynx -dump "$URL" | sed -n -e '/^References$/,$s/^ *[0-9]\+\. \+//p' | sed -e 's/ /%20/g'
8     done
9 }
10
11 extract_functions () {
12     sed -n -e '/^New Procedures and Functions$/,/^\w/ s/.* \(\w\+\)(.*$/\1/p' "$@" \
13     | sed -e '/^[A-Z]/s/^/gl/'
14 }
15
16 extract_urls http://www.opengl.org/registry/ \
17 | grep '^http://www\.opengl\.org/registry/specs/ARB/.*\.txt$' \
18 | sort -u \
19 | while read URL
20 do
21     wget --quiet -O - $URL \
22     | extract_functions \
23     | while read FUNCTION
24     do
25         echo "$FUNCTION  $URL"
26     done
27 done
28     
29                 
30