1:255.16-alt1
[systemd_ALT.git] / tools / check-api-docs.sh
blob2e973a088beac0aa435ddb1ff20485ef7bdc7890
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eu
4 set -o pipefail
6 sd_good=0
7 sd_total=0
8 udev_good=0
9 udev_total=0
11 deprecated=(
12 -e sd_bus_try_close
13 -e sd_bus_process_priority
14 -e sd_bus_message_get_priority
15 -e sd_bus_message_set_priority
16 -e sd_seat_can_multi_session
17 -e sd_journal_open_container
20 for symbol in $(nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv "${deprecated[@]}" | sort -u); do
21 if test -f "${MESON_BUILD_ROOT:?}/man/$symbol.3"; then
22 echo "✓ Symbol $symbol() is documented."
23 good=1
24 else
25 echo -e " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m"
26 good=0
29 case "$symbol" in
30 sd_*)
31 ((sd_good+=good))
32 ((sd_total+=1))
34 udev_*)
35 ((udev_good+=good))
36 ((udev_total+=1))
39 echo 'unknown symbol prefix'
40 exit 1
41 esac
42 done
44 echo "libsystemd: $sd_good/$sd_total libudev: $udev_good/$udev_total"