]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/check-api-docs.sh
Merge pull request #32336 from teknoraver/foreach_element
[thirdparty/systemd.git] / tools / check-api-docs.sh
CommitLineData
f1e6f933 1#!/usr/bin/env bash
9ee03516 2# SPDX-License-Identifier: LGPL-2.1-or-later
51b13863 3set -eu
3b6fd3c1 4set -o pipefail
51b13863 5
65889ab7
ZJS
6sd_good=0
7sd_total=0
8udev_good=0
9udev_total=0
10
3b6fd3c1 11deprecated=(
eb74579d
DDM
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
8f8cc84b 16 -e sd_seat_can_multi_session
622018c5 17 -e sd_journal_open_container
3b6fd3c1 18)
eb74579d 19
3b6fd3c1
FS
20for 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
cc5549ca
ZJS
22 echo "✓ Symbol $symbol() is documented."
23 good=1
24 else
3b6fd3c1 25 echo -e " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m"
cc5549ca
ZJS
26 good=0
27 fi
65889ab7 28
3b6fd3c1 29 case "$symbol" in
cc5549ca
ZJS
30 sd_*)
31 ((sd_good+=good))
32 ((sd_total+=1))
33 ;;
34 udev_*)
35 ((udev_good+=good))
36 ((udev_total+=1))
37 ;;
38 *)
39 echo 'unknown symbol prefix'
40 exit 1
41 esac
51b13863 42done
65889ab7
ZJS
43
44echo "libsystemd: $sd_good/$sd_total libudev: $udev_good/$udev_total"