1 /* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 #include <errno.h>
7 #include <getopt.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10
11 #include "adhd_alsa.h"
12
13 static unsigned arg_verbose = 0;
14
help(void)15 static void help(void)
16 {
17 /* TODO(thutt): Add help */
18 }
19
process_arguments(int argc,char ** argv)20 static void process_arguments(int argc, char **argv)
21 {
22 static struct option options[] = {
23 {
24 .name = "help",
25 .has_arg = no_argument,
26 .flag = NULL,
27 .val = 256
28 },
29 {
30 .name = "verbose",
31 .has_arg = no_argument,
32 .flag = NULL,
33 .val = 257
34 },
35 };
36
37 while (1) {
38 int option_index = 0;
39 const int choice = getopt_long(argc, argv, "", options, &option_index);
40
41 if (choice == -1) {
42 break;
43 }
44
45 switch (choice) {
46 case 256:
47 help();
48 break;
49
50 case 257:
51 arg_verbose = 1;
52 break;
53
54 default:
55 printf("?? getopt returned character code 0%o ??\n", choice);
56 }
57 }
58 }
59
60
main(int argc,char ** argv)61 int main(int argc, char **argv)
62 {
63 adhd_alsa_info_t alsa_info;
64 process_arguments(argc, argv);
65
66 adhd_alsa_get_all_card_info(&alsa_info);
67 adhd_alsa_release_card_info(&alsa_info);
68 return 0;
69 }
70