summaryrefslogtreecommitdiff
path: root/test/namehint.c
blob: 18bad1d885005e29e6d834398a96493248076e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../include/asoundlib.h"
#include <err.h>

int main(int argc, char *argv[])
{
	const char *iface = "pcm";
	void **hints;
	char **n;
	int err;

	if (argc > 1)
		iface = argv[1];
	err = snd_device_name_hint(-1, iface, &hints);
	if (err < 0)
		errx(1, "snd_device_name_hint error: %s", snd_strerror(err));
	n = (char **)hints;
	while (*n != NULL) {
		printf("%s\n", *n);
		n++;
	}
	snd_device_name_free_hint(hints);
	return 0;
}