blob: 789c4afc6777ba61c74f559646f61d510e040b12 [file] [log] [blame]
Simon Wilsonedff7082011-06-06 15:33:34 -07001/* tinymix.c
2**
3** Copyright 2011, The Android Open Source Project
4**
5** Redistribution and use in source and binary forms, with or without
6** modification, are permitted provided that the following conditions are met:
7** * Redistributions of source code must retain the above copyright
8** notice, this list of conditions and the following disclaimer.
9** * Redistributions in binary form must reproduce the above copyright
10** notice, this list of conditions and the following disclaimer in the
11** documentation and/or other materials provided with the distribution.
12** * Neither the name of The Android Open Source Project nor the names of
13** its contributors may be used to endorse or promote products derived
14** from this software without specific prior written permission.
15**
16** THIS SOFTWARE IS PROVIDED BY The Android Open Source Project ``AS IS'' AND
17** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19** ARE DISCLAIMED. IN NO EVENT SHALL The Android Open Source Project BE LIABLE
20** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26** DAMAGE.
27*/
28
29#include <tinyalsa/asoundlib.h>
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +010030#include <errno.h>
Simon Wilsonedff7082011-06-06 15:33:34 -070031#include <stdio.h>
32#include <stdlib.h>
33#include <ctype.h>
Simon Wilsonda39e0b2012-11-09 15:16:47 -080034#include <string.h>
John Muircf4bf352016-02-15 14:14:02 -080035#include <getopt.h>
36#include <errno.h>
Simon Wilsonedff7082011-06-06 15:33:34 -070037
38static void tinymix_list_controls(struct mixer *mixer);
John Muircf4bf352016-02-15 14:14:02 -080039static int tinymix_detail_control(struct mixer *mixer, const char *control,
40 int prefix, int print_all);
41static int tinymix_set_value(struct mixer *mixer, const char *control,
42 char **values, unsigned int num_values);
43static void tinymix_print_enum(struct mixer_ctl *ctl, const char *space,
44 int print_all);
45
46static const char *tinymix_short_options = "D:atvh";
47static struct option tinymix_long_options[] = {
48 {"device", required_argument, 0, 'D'},
49 {"all-values", no_argument, 0, 'a'},
50 {"tabs-only", no_argument, 0, 't'},
51 {"value-only", no_argument, 0, 'v'},
52 {"help", no_argument, 0, 'h'},
53 {0, 0, 0, 0}
54};
55
56static int g_tabs_only = 0;
57static int g_all_values = 0;
58static int g_value_only = 0;
59
60static void usage (void) {
61 fprintf(stderr,
62"tinymix [options] [control name/#] [value to set]\n"
63" options:\n"
64" --device|-D <card#> - use the given card # instead of 0.\n"
65" --all-values|-a - show all possible values/ranges for control.\n"
66" --tabs-only|-t - separate all output columns/values with tabs.\n"
67" --value-only|-v - show only the value for the selected control.\n"
68 );
69}
Simon Wilsonedff7082011-06-06 15:33:34 -070070
71int main(int argc, char **argv)
72{
73 struct mixer *mixer;
Simon Wilsondaa83292012-02-28 15:26:02 -080074 int card = 0;
John Muircf4bf352016-02-15 14:14:02 -080075 int ret = 0;
Simon Wilsonedff7082011-06-06 15:33:34 -070076
John Muircf4bf352016-02-15 14:14:02 -080077 while (1) {
78 int option_index = 0;
79 int option_char = 0;
80
81 option_char = getopt_long(argc, argv, tinymix_short_options,
82 tinymix_long_options, &option_index);
83 if (option_char == -1)
84 break;
85
86 switch (option_char) {
87 case 'D':
88 card = atoi(optarg);
89 break;
90 case 'a':
91 g_all_values = 1;
92 break;
93 case 't':
94 g_tabs_only = 1;
95 break;
96 case 'v':
97 g_value_only = 1;
98 break;
99 case 'h':
100 usage();
101 return 0;
102 default:
103 usage();
104 return EINVAL;
Simon Wilsondaa83292012-02-28 15:26:02 -0800105 }
106 }
107
108 mixer = mixer_open(card);
Simon Wilsonc1239622011-07-27 15:08:34 -0700109 if (!mixer) {
110 fprintf(stderr, "Failed to open mixer\n");
John Muircf4bf352016-02-15 14:14:02 -0800111 return ENODEV;
Simon Wilsonc1239622011-07-27 15:08:34 -0700112 }
Simon Wilsonedff7082011-06-06 15:33:34 -0700113
John Muircf4bf352016-02-15 14:14:02 -0800114 if (argc == optind) {
Simon Wilson36ea2d82013-07-17 11:10:45 -0700115 printf("Mixer name: '%s'\n", mixer_get_name(mixer));
Simon Wilsonedff7082011-06-06 15:33:34 -0700116 tinymix_list_controls(mixer);
John Muircf4bf352016-02-15 14:14:02 -0800117 } else if (argc == optind + 1) {
118 ret = tinymix_detail_control(mixer, argv[optind], !g_value_only, !g_value_only);
119 } else if (argc >= optind + 2) {
120 ret = tinymix_set_value(mixer, argv[optind], &argv[optind + 1], argc - optind - 1);
Simon Wilson36ea2d82013-07-17 11:10:45 -0700121 }
Simon Wilsonedff7082011-06-06 15:33:34 -0700122
123 mixer_close(mixer);
124
John Muircf4bf352016-02-15 14:14:02 -0800125 return ret;
Simon Wilsonedff7082011-06-06 15:33:34 -0700126}
127
HW Leef2d93a52019-05-20 17:38:18 +0800128static int isnumber(const char *str) {
129 char *end;
130
131 if (str == NULL || strlen(str) == 0)
132 return 0;
133
134 strtol(str, &end, 0);
135 return strlen(end) == 0;
136}
137
Simon Wilsonedff7082011-06-06 15:33:34 -0700138static void tinymix_list_controls(struct mixer *mixer)
139{
140 struct mixer_ctl *ctl;
Simon Wilsone44e30a2012-03-08 10:45:31 -0800141 const char *name, *type;
Simon Wilsonedff7082011-06-06 15:33:34 -0700142 unsigned int num_ctls, num_values;
Simon Wilsonedff7082011-06-06 15:33:34 -0700143 unsigned int i;
144
145 num_ctls = mixer_get_num_ctls(mixer);
146
Dong Jinguanga1902c02017-12-20 10:18:09 +0800147 printf("Number of controls: %u\n", num_ctls);
Simon Wilsonedff7082011-06-06 15:33:34 -0700148
John Muircf4bf352016-02-15 14:14:02 -0800149 if (g_tabs_only)
150 printf("ctl\ttype\tnum\tname\tvalue");
151 else
152 printf("ctl\ttype\tnum\t%-40s value\n", "name");
153 if (g_all_values)
154 printf("\trange/values\n");
155 else
156 printf("\n");
Simon Wilsonedff7082011-06-06 15:33:34 -0700157 for (i = 0; i < num_ctls; i++) {
158 ctl = mixer_get_ctl(mixer, i);
159
Simon Wilsone44e30a2012-03-08 10:45:31 -0800160 name = mixer_ctl_get_name(ctl);
Simon Wilsonedff7082011-06-06 15:33:34 -0700161 type = mixer_ctl_get_type_string(ctl);
162 num_values = mixer_ctl_get_num_values(ctl);
John Muircf4bf352016-02-15 14:14:02 -0800163 if (g_tabs_only)
164 printf("%d\t%s\t%d\t%s\t", i, type, num_values, name);
165 else
166 printf("%d\t%s\t%d\t%-40s ", i, type, num_values, name);
167 tinymix_detail_control(mixer, name, 0, g_all_values);
Simon Wilsonedff7082011-06-06 15:33:34 -0700168 }
169}
170
John Muircf4bf352016-02-15 14:14:02 -0800171static void tinymix_print_enum(struct mixer_ctl *ctl, const char *space,
172 int print_all)
Simon Wilsonedff7082011-06-06 15:33:34 -0700173{
174 unsigned int num_enums;
Simon Wilsonedff7082011-06-06 15:33:34 -0700175 unsigned int i;
Simon Wilsone44e30a2012-03-08 10:45:31 -0800176 const char *string;
John Muircf4bf352016-02-15 14:14:02 -0800177 int control_value = mixer_ctl_get_value(ctl, 0);
Simon Wilsonedff7082011-06-06 15:33:34 -0700178
John Muircf4bf352016-02-15 14:14:02 -0800179 if (print_all) {
180 num_enums = mixer_ctl_get_num_enums(ctl);
181 for (i = 0; i < num_enums; i++) {
182 string = mixer_ctl_get_enum_string(ctl, i);
183 printf("%s%s%s",
184 control_value == (int)i ? ">" : "", string,
185 (i < num_enums - 1) ? space : "");
186 }
187 }
188 else {
189 string = mixer_ctl_get_enum_string(ctl, control_value);
190 printf("%s", string);
Simon Wilsonedff7082011-06-06 15:33:34 -0700191 }
192}
193
John Muircf4bf352016-02-15 14:14:02 -0800194static int tinymix_detail_control(struct mixer *mixer, const char *control,
195 int prefix, int print_all)
Simon Wilsonedff7082011-06-06 15:33:34 -0700196{
197 struct mixer_ctl *ctl;
198 enum mixer_ctl_type type;
199 unsigned int num_values;
Simon Wilsonedff7082011-06-06 15:33:34 -0700200 unsigned int i;
201 int min, max;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100202 int ret;
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530203 char *buf = NULL;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100204 size_t len;
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530205 unsigned int tlv_header_size = 0;
John Muircf4bf352016-02-15 14:14:02 -0800206 const char *space = g_tabs_only ? "\t" : " ";
Simon Wilsonedff7082011-06-06 15:33:34 -0700207
HW Leef2d93a52019-05-20 17:38:18 +0800208 if (isnumber(control))
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800209 ctl = mixer_get_ctl(mixer, atoi(control));
210 else
211 ctl = mixer_get_ctl_by_name(mixer, control);
212
213 if (!ctl) {
John Muircf4bf352016-02-15 14:14:02 -0800214 fprintf(stderr, "Invalid mixer control: %s\n", control);
215 return ENOENT;
Simon Wilsonedff7082011-06-06 15:33:34 -0700216 }
217
Simon Wilsonedff7082011-06-06 15:33:34 -0700218 type = mixer_ctl_get_type(ctl);
219 num_values = mixer_ctl_get_num_values(ctl);
220
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100221 if (type == MIXER_CTL_TYPE_BYTE) {
Pankaj Bharadiya10d4b8f2017-01-04 11:10:58 +0530222 if (mixer_ctl_is_access_tlv_rw(ctl)) {
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530223 tlv_header_size = TLV_HEADER_SIZE;
224 }
225 buf = calloc(1, num_values + tlv_header_size);
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530226 if (buf == NULL) {
227 fprintf(stderr, "Failed to alloc mem for bytes %d\n", num_values);
John Muircf4bf352016-02-15 14:14:02 -0800228 return ENOENT;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100229 }
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530230
231 len = num_values;
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530232 ret = mixer_ctl_get_array(ctl, buf, len + tlv_header_size);
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100233 if (ret < 0) {
234 fprintf(stderr, "Failed to mixer_ctl_get_array\n");
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530235 free(buf);
John Muircf4bf352016-02-15 14:14:02 -0800236 return ENOENT;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100237 }
238 }
239
John Muircf4bf352016-02-15 14:14:02 -0800240 if (prefix)
241 printf("%s:%s", mixer_ctl_get_name(ctl), space);
Simon Wilson62104732011-08-05 12:00:00 -0700242
Simon Wilsonedff7082011-06-06 15:33:34 -0700243 for (i = 0; i < num_values; i++) {
244 switch (type)
245 {
246 case MIXER_CTL_TYPE_INT:
John Muircf4bf352016-02-15 14:14:02 -0800247 printf("%d", mixer_ctl_get_value(ctl, i));
Simon Wilsonedff7082011-06-06 15:33:34 -0700248 break;
249 case MIXER_CTL_TYPE_BOOL:
John Muircf4bf352016-02-15 14:14:02 -0800250 printf("%s", mixer_ctl_get_value(ctl, i) ? "On" : "Off");
Simon Wilsonedff7082011-06-06 15:33:34 -0700251 break;
252 case MIXER_CTL_TYPE_ENUM:
John Muircf4bf352016-02-15 14:14:02 -0800253 tinymix_print_enum(ctl, space, print_all);
Simon Wilsonedff7082011-06-06 15:33:34 -0700254 break;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100255 case MIXER_CTL_TYPE_BYTE:
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530256 /* skip printing TLV header if exists */
257 printf(" %02x", buf[i + tlv_header_size]);
Simon Wilson5aed71d2011-11-16 14:45:38 -0800258 break;
Simon Wilsonedff7082011-06-06 15:33:34 -0700259 default:
John Muircf4bf352016-02-15 14:14:02 -0800260 printf("unknown");
Simon Wilsonedff7082011-06-06 15:33:34 -0700261 break;
John Muircf4bf352016-02-15 14:14:02 -0800262 }
263
264 if (i < num_values - 1)
265 printf("%s", space);
Simon Wilsonedff7082011-06-06 15:33:34 -0700266 }
Simon Wilson62104732011-08-05 12:00:00 -0700267
268 if (print_all) {
269 if (type == MIXER_CTL_TYPE_INT) {
270 min = mixer_ctl_get_range_min(ctl);
271 max = mixer_ctl_get_range_max(ctl);
John Muircf4bf352016-02-15 14:14:02 -0800272 printf("%s(dsrange %d->%d)", space, min, max);
Simon Wilson62104732011-08-05 12:00:00 -0700273 }
Simon Wilsonedff7082011-06-06 15:33:34 -0700274 }
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530275
276 free(buf);
277
Simon Wilsonedff7082011-06-06 15:33:34 -0700278 printf("\n");
John Muircf4bf352016-02-15 14:14:02 -0800279 return 0;
Simon Wilsonedff7082011-06-06 15:33:34 -0700280}
281
Samreen Nilofer56754eb2015-04-02 11:59:08 +0530282static void tinymix_set_byte_ctl(struct mixer_ctl *ctl,
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100283 char **values, unsigned int num_values)
284{
285 int ret;
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530286 char *buf;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100287 char *end;
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530288 unsigned int i;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100289 long n;
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530290 unsigned int *tlv, tlv_size;
291 unsigned int tlv_header_size = 0;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100292
Pankaj Bharadiya10d4b8f2017-01-04 11:10:58 +0530293 if (mixer_ctl_is_access_tlv_rw(ctl)) {
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530294 tlv_header_size = TLV_HEADER_SIZE;
295 }
296
297 tlv_size = num_values + tlv_header_size;
298
299 buf = calloc(1, tlv_size);
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530300 if (buf == NULL) {
301 fprintf(stderr, "set_byte_ctl: Failed to alloc mem for bytes %d\n", num_values);
302 exit(EXIT_FAILURE);
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100303 }
304
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530305 tlv = (unsigned int *)buf;
306 tlv[0] = 0;
307 tlv[1] = num_values;
308
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100309 for (i = 0; i < num_values; i++) {
310 errno = 0;
311 n = strtol(values[i], &end, 0);
312 if (*end) {
313 fprintf(stderr, "%s not an integer\n", values[i]);
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530314 goto fail;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100315 }
316 if (errno) {
317 fprintf(stderr, "strtol: %s: %s\n", values[i],
318 strerror(errno));
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530319 goto fail;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100320 }
321 if (n < 0 || n > 0xff) {
322 fprintf(stderr, "%s should be between [0, 0xff]\n",
323 values[i]);
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530324 goto fail;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100325 }
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530326 /* start filling after the TLV header */
327 buf[i + tlv_header_size] = n;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100328 }
329
Pawse, GuruprasadXb4e8d0d2016-02-02 17:52:29 +0530330 ret = mixer_ctl_set_array(ctl, buf, tlv_size);
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100331 if (ret < 0) {
332 fprintf(stderr, "Failed to set binary control\n");
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530333 goto fail;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100334 }
Samreen Nilofere3e1bce2015-04-02 11:57:29 +0530335
336 free(buf);
337 return;
338
339fail:
340 free(buf);
341 exit(EXIT_FAILURE);
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100342}
343
John Muircf4bf352016-02-15 14:14:02 -0800344static int tinymix_set_value(struct mixer *mixer, const char *control,
345 char **values, unsigned int num_values)
Simon Wilsonedff7082011-06-06 15:33:34 -0700346{
347 struct mixer_ctl *ctl;
348 enum mixer_ctl_type type;
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800349 unsigned int num_ctl_values;
Simon Wilsonedff7082011-06-06 15:33:34 -0700350 unsigned int i;
351
HW Leef2d93a52019-05-20 17:38:18 +0800352 if (isnumber(control))
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800353 ctl = mixer_get_ctl(mixer, atoi(control));
354 else
355 ctl = mixer_get_ctl_by_name(mixer, control);
356
357 if (!ctl) {
John Muircf4bf352016-02-15 14:14:02 -0800358 fprintf(stderr, "Invalid mixer control: %s\n", control);
359 return ENOENT;
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800360 }
361
Simon Wilsonedff7082011-06-06 15:33:34 -0700362 type = mixer_ctl_get_type(ctl);
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800363 num_ctl_values = mixer_ctl_get_num_values(ctl);
Simon Wilsonedff7082011-06-06 15:33:34 -0700364
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100365 if (type == MIXER_CTL_TYPE_BYTE) {
Samreen Nilofer56754eb2015-04-02 11:59:08 +0530366 tinymix_set_byte_ctl(ctl, values, num_values);
John Muircf4bf352016-02-15 14:14:02 -0800367 return ENOENT;
Dimitris Papastamosf3a9e412013-10-25 19:24:06 +0100368 }
369
HW Leef2d93a52019-05-20 17:38:18 +0800370 if (isnumber(values[0])) {
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800371 if (num_values == 1) {
372 /* Set all values the same */
373 int value = atoi(values[0]);
Simon Wilsonedff7082011-06-06 15:33:34 -0700374
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800375 for (i = 0; i < num_ctl_values; i++) {
376 if (mixer_ctl_set_value(ctl, i, value)) {
377 fprintf(stderr, "Error: invalid value\n");
John Muircf4bf352016-02-15 14:14:02 -0800378 return EINVAL;
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800379 }
380 }
381 } else {
382 /* Set multiple values */
383 if (num_values > num_ctl_values) {
384 fprintf(stderr,
Dong Jinguanga1902c02017-12-20 10:18:09 +0800385 "Error: %u values given, but control only takes %u\n",
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800386 num_values, num_ctl_values);
John Muircf4bf352016-02-15 14:14:02 -0800387 return EINVAL;
Simon Wilsonedff7082011-06-06 15:33:34 -0700388 }
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800389 for (i = 0; i < num_values; i++) {
390 if (mixer_ctl_set_value(ctl, i, atoi(values[i]))) {
391 fprintf(stderr, "Error: invalid value for index %d\n", i);
John Muircf4bf352016-02-15 14:14:02 -0800392 return EINVAL;
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800393 }
394 }
Simon Wilsonedff7082011-06-06 15:33:34 -0700395 }
396 } else {
397 if (type == MIXER_CTL_TYPE_ENUM) {
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800398 if (num_values != 1) {
399 fprintf(stderr, "Enclose strings in quotes and try again\n");
John Muircf4bf352016-02-15 14:14:02 -0800400 return EINVAL;
Simon Wilsonda39e0b2012-11-09 15:16:47 -0800401 }
John Muircf4bf352016-02-15 14:14:02 -0800402 if (mixer_ctl_set_enum_by_string(ctl, values[0])) {
Simon Wilsonedff7082011-06-06 15:33:34 -0700403 fprintf(stderr, "Error: invalid enum value\n");
John Muircf4bf352016-02-15 14:14:02 -0800404 return EINVAL;
405 }
Simon Wilsonedff7082011-06-06 15:33:34 -0700406 } else {
407 fprintf(stderr, "Error: only enum types can be set with strings\n");
John Muircf4bf352016-02-15 14:14:02 -0800408 return EINVAL;
Simon Wilsonedff7082011-06-06 15:33:34 -0700409 }
410 }
Simon Wilsonedff7082011-06-06 15:33:34 -0700411
John Muircf4bf352016-02-15 14:14:02 -0800412 return 0;
413}