btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / bin / get_driver_settings.cpp
blob012417dc3555b3d36f4a3a9c6b9329bbdbe9d642
1 /*
2 * Copyright 2017, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * <François Revol>
7 */
9 #include <stdio.h>
11 #include <driver_settings.h>
13 static const char *sTabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
15 int usage(const char *progname)
17 return 1;
20 void print_params(int indent, const driver_parameter *p)
22 printf("indent: %d\n", indent);
23 printf("%.*s'%s': [", indent, sTabs, p->name);
24 for (int i = 0; i < p->value_count; i++) {
25 printf(" '%s',", p->values[i]);
27 printf("]\n");
28 indent++;
29 for (int i = 0; i < p->parameter_count; i++)
30 print_params(indent, &p->parameters[i]);
33 int main(int argc, char **argv)
35 void *h;
36 const driver_settings *s;
37 h = load_driver_settings(argv[1]);
38 if (h == NULL)
39 return usage(argv[0]);
41 s = get_driver_settings(h);
43 printf("%d\n", s->parameter_count);
44 for (int i = 0; i < s->parameter_count; i++) {
45 print_params(0, &s->parameters[i]);
48 unload_driver_settings(h);
50 return 0;