]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tools/checklibdocs.sh
lib/pty: reset mainloop timeout on signal
[thirdparty/util-linux.git] / tools / checklibdocs.sh
CommitLineData
58354269
KZ
1#!/bin/sh
2
3FILE_API_SYMBOLS="$1"
4FILE_API_DOCS="$2"
5
6if [ ! -f "$FILE_API_SYMBOLS" ]; then
7 echo "File $FILE_API_SYMBOLS is missing."
8 exit 1
9fi
10
11if [ ! -f "$FILE_API_DOCS" ]; then
12 echo "File $FILE_API_DOCS is missing."
13 exit 1
14fi
15
16fail_ct=0
17api_symbols=$(awk '/^([[:space:]]+)([[:alnum:]_]+);/ { gsub(";",""); print $1; }' "$FILE_API_SYMBOLS" | sort)
18doc_symbols=$(awk '/^([[:space:]])*$/ {next}; !/<.*>/ { print $1 }' "$FILE_API_DOCS" | sort)
19
20echo -n "Checking $FILE_API_SYMBOLS documentation ... "
21
22for sym in $api_symbols; do
23 case "$doc_symbols" in
24 *"$sym"*)
25 #echo -ne "\n '$sym'"
26 ;;
27 *)
28 echo -ne "\n '$sym' undocumented"
29 fail_ct=$(($fail_ct + 1))
30 ;;
31 esac
32done
33
34if [ $fail_ct -ne 0 ]; then
35 echo
36 echo "$fail_ct symbols is missing in ${FILE_API_DOCS}."
37 echo
38 exit 1
39else
40 echo "OK"
41fi
42
43exit 0