18c2ecf20Sopenharmony_ci#!/bin/sh
28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: LGPL-2.1
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/sound/
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciprintf "static const char *sndrv_pcm_ioctl_cmds[] = {\n"
78c2ecf20Sopenharmony_cigrep "^#define[\t ]\+SNDRV_PCM_IOCTL_" $header_dir/asound.h | \
88c2ecf20Sopenharmony_ci	sed -r 's/^#define +SNDRV_PCM_IOCTL_([A-Z0-9_]+)[\t ]+_IO[RW]*\( *.A., *(0x[[:xdigit:]]+),?.*/\t[\2] = \"\1\",/g'
98c2ecf20Sopenharmony_ciprintf "};\n"
10