BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / devices / devlist2h.awk
blobcdc92aea4c0fdeb94fcbd40dca6121d4ee6fe4a1
1 #!/bin/awk
2 # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
4 # Copyright (c) 2004, Haiku
6 # This software is part of the Haiku distribution and is covered
7 # by the Haiku license.
10 # File: devlist2h.awk
11 # Author: Jérôme Duval
12 # Description: Devices Preferences
13 # Created : July 8, 2004
15 # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
17 BEGIN {
18 FS=" "
20 NR == 1 {
21 printf("/*\tHaiku" "$\t*/\n\n")
22 printf("/*\n")
23 printf(" This file is generated automatically. Don't edit. \n")
24 printf("\n*/")
27 NF > 0 {
28 n++
30 ids[n, 1] = $1;
31 ids[n, 2] = $2;
35 END {
36 printf("\n")
37 printf("typedef struct { char* id; char* devname; } idTable;\n")
38 printf("idTable isapnp_devids [] = {\n")
39 for (i = 1; i <= n; i++) {
40 printf("\t{\n")
41 printf("\t\t\"%s\", \"%s\"\n", ids[i,1], ids[i,2])
42 printf("\t},\n")
44 printf("\t};\n")
45 printf("// Use this value for loop control during searching:\n")
46 printf("#define ISA_DEVTABLE_LEN %i\n", n)