summaryrefslogtreecommitdiff
path: root/src/basic/generate-af-list.sh
blob: 0a5c5c4cd7673e0ef95581a31dd1b1b5df7baf6c (plain)
1
2
3
4
5
6
7
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eu

$1 -E -dM -include sys/socket.h -include "$2" -include "$3" - </dev/null | \
    grep -Ev 'AF_UNSPEC|AF_MAX' | \
    awk '/^#define[ \t]+AF_[^ \t]+[ \t]+[AP]F_[^ \t]/ { print $2; }'