162306a36Sopenharmony_ci#!/bin/sh
262306a36Sopenharmony_ci# SPDX-License-Identifier: LGPL-2.1
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/sound/
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciprintf "static const char *sndrv_ctl_ioctl_cmds[] = {\n"
762306a36Sopenharmony_cigrep "^#define[\t ]\+SNDRV_CTL_IOCTL_" $header_dir/asound.h | \
862306a36Sopenharmony_ci	sed -r 's/^#define +SNDRV_CTL_IOCTL_([A-Z0-9_]+)[\t ]+_IO[RW]*\( *.U., *(0x[[:xdigit:]]+),?.*/\t[\2] = \"\1\",/g'
962306a36Sopenharmony_ciprintf "};\n"
10