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

${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; }'