Implement CryptImport/ExportPublicKeyInfo.
[wine] / dlls / dxerr8 / errors.awk
1 BEGIN {
2         print "/* Machine generated. Do not edit. */"
3         print ""
4         lines = 0
5 }
6
7         split($0, array, FS)
8
9         if (NF > 0 && length(array[1]) > 0) {
10                 lines++
11
12                 # save the first word is the names array
13                 names[lines] = array[1] 
14
15                 # create the WCHAR version of the name
16                 printf "static const WCHAR name%dW[] = { ", lines
17                 i = 1
18                 len = length(array[1]) + 1
19                 while (i < len) {
20                         printf "'%s',", substr(array[1],i,1)
21                         i++
22                 }
23                 print  "0 };"
24         
25                 # create the CHAR version of the description
26                 printf "static const CHAR description%dA[] = \"", lines
27                 word = 2
28                 while (word < (NF + 1)) {
29                         printf "%s", array[word]
30                         if (word < NF )
31                                 printf " "
32                         word++
33                 }
34                 print  "\";"
35         
36                 # create the WCHAR version of the description
37                 printf "static const WCHAR description%dW[] = { ", lines
38                 word = 2
39                 while (word < (NF + 1)) {
40                         i = 1
41                         len = length(array[word]) + 1
42                         while (i < len) {
43                                 if (substr(array[word],i,1) == "\'")
44                                         printf "'\\'',"
45                                 else
46                                         printf "'%s',", substr(array[word],i,1)
47                                 i++
48                         }
49                         if (word < NF )
50                                 printf "' ',"
51                         word++
52                 }
53                 print  "0 };"
54         }
55 }
56 END {
57         print ""
58         print "static const error_info info[] = {"
59
60         i = 1 
61         while ( i <= lines) { 
62                 printf "    { %s, \"%s\", name%dW, description%dA, description%dW },\n", 
63                         names[i], names[i], i, i,i 
64                 i++
65         }
66
67         print "};"
68 }