Dmitry V. Levin | 38a34c9 | 2015-12-17 17:56:48 +0000 | [diff] [blame] | 1 | #!/bin/gawk |
| 2 | # |
| 3 | # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com> |
Dmitry V. Levin | cc902e3 | 2016-01-13 02:31:12 +0000 | [diff] [blame] | 4 | # Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org> |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 5 | # Copyright (c) 2015-2018 The strace developers. |
Dmitry V. Levin | 38a34c9 | 2015-12-17 17:56:48 +0000 | [diff] [blame] | 6 | # All rights reserved. |
| 7 | # |
| 8 | # Redistribution and use in source and binary forms, with or without |
| 9 | # modification, are permitted provided that the following conditions |
| 10 | # are met: |
| 11 | # 1. Redistributions of source code must retain the above copyright |
| 12 | # notice, this list of conditions and the following disclaimer. |
| 13 | # 2. Redistributions in binary form must reproduce the above copyright |
| 14 | # notice, this list of conditions and the following disclaimer in the |
| 15 | # documentation and/or other materials provided with the distribution. |
| 16 | # 3. The name of the author may not be used to endorse or promote products |
| 17 | # derived from this software without specific prior written permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 21 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 22 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 23 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 24 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 30 | function array_get(array_idx, array_member, \ |
| 31 | array_return) |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 32 | { |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 33 | array_return = array[array_idx, array_member] |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 34 | if ("" == array_return) { |
| 35 | printf("%s: index [%s] without %s\n", |
| 36 | FILENAME, array_idx, array_member) > "/dev/stderr" |
| 37 | exit 1 |
| 38 | } |
| 39 | return array_return |
| 40 | } |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 41 | function norm_idx(idx) |
| 42 | { |
| 43 | return sprintf("%016s", idx) |
| 44 | } |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 45 | function array_seq(array_idx) |
| 46 | { |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 47 | if ((array_idx, "seq") in array) |
| 48 | return array[array_idx, "seq"] |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 49 | index_seq++ |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 50 | array[array_idx, "seq"] = index_seq |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 51 | return index_seq |
| 52 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 53 | function enter(array_idx, |
| 54 | item) |
Dmitry V. Levin | 54d18a2 | 2015-12-15 03:35:26 +0000 | [diff] [blame] | 55 | { |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 56 | if (array_idx in called) { |
Dmitry V. Levin | 54d18a2 | 2015-12-15 03:35:26 +0000 | [diff] [blame] | 57 | printf("%s: index loop detected:", FILENAME) > "/dev/stderr" |
| 58 | for (item in called) |
| 59 | printf(" %s", item) > "/dev/stderr" |
| 60 | print "" > "/dev/stderr" |
| 61 | exit 1 |
| 62 | } |
| 63 | called[array_idx] = 1 |
| 64 | } |
| 65 | function leave(array_idx, to_return) |
| 66 | { |
| 67 | delete called[array_idx] |
| 68 | return to_return |
| 69 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 70 | function update_upper_bound(idx, val, \ |
| 71 | count) |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 72 | { |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 73 | count = array[idx, "count"] |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 74 | if (count == "") |
| 75 | count = 1 |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 76 | array[idx, "count"] = count * val |
| 77 | array[idx, "upper_bound"] = array[idx, "upper_bound"] "[" val "]" |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 78 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 79 | function what_is(what_idx, \ |
| 80 | item, loc_diff, location, prev_location, prev_returned_size, \ |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 81 | special, to_return, type_idx, enc, i) |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 82 | { |
Dmitry V. Levin | 54d18a2 | 2015-12-15 03:35:26 +0000 | [diff] [blame] | 83 | enter(what_idx) |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 84 | special = array_get(what_idx, "special") |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 85 | if (special == "base_type") { |
| 86 | enc = array_get(what_idx, "encoding") |
| 87 | if (enc == 5) { # signed |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 88 | printf("int%s_t ", |
| 89 | 8 * array_get(what_idx, "byte_size")) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 90 | } else if (enc == 7) { # unsigned |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 91 | printf("uint%s_t ", |
| 92 | 8 * array_get(what_idx, "byte_size")) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 93 | } else { # float, signed/unsigned char |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 94 | printf("%s ", array_get(what_idx, "name")) |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 95 | } |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 96 | returned_size = array_get(what_idx, "byte_size") |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 97 | } else if (special == "enumeration_type") { |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 98 | returned_size = array_get(what_idx, "byte_size") |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 99 | printf("uint%s_t ", 8 * returned_size) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 100 | } else if (special == "pointer_type") { |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 101 | printf("mpers_ptr_t ") |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 102 | returned_size = array_get(what_idx, "byte_size") |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 103 | } else if (special == "array_type") { |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 104 | type_idx = array_get(what_idx, "type") |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 105 | what_is(type_idx) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 106 | to_return = array[what_idx, "upper_bound"] |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 107 | if ("" == to_return) |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 108 | to_return = "[0]" |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 109 | returned_size = array[what_idx, "count"] * returned_size |
Dmitry V. Levin | 54d18a2 | 2015-12-15 03:35:26 +0000 | [diff] [blame] | 110 | return leave(what_idx, to_return) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 111 | } else if (special == "structure_type") { |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 112 | print "struct {" |
| 113 | prev_location = 0 |
| 114 | location = 0 |
| 115 | returned_size = 0 |
| 116 | prev_returned_size = 0 |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 117 | for (i = 1; i <= parents_cnt; i += 1) { |
| 118 | if (array_parents[aparents_keys[i]] == what_idx) { |
| 119 | location = array_get(aparents_keys[i], "location") |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 120 | loc_diff = location - prev_location - \ |
| 121 | prev_returned_size |
| 122 | if (loc_diff != 0) { |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 123 | printf("unsigned char mpers_%s_%s[%s];\n", |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 124 | "filler", array_seq(aparents_keys[i]), loc_diff) |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 125 | } |
| 126 | prev_location = location |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 127 | returned = what_is(aparents_keys[i]) |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 128 | prev_returned_size = returned_size |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 129 | printf("%s%s;\n", array[aparents_keys[i], "name"], returned) |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 130 | } |
| 131 | } |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 132 | returned_size = array_get(what_idx, "byte_size") |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 133 | loc_diff = returned_size - prev_location - prev_returned_size |
| 134 | if (loc_diff != 0) { |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 135 | printf("unsigned char mpers_%s_%s[%s];\n", |
| 136 | "end_filler", array_seq(item), loc_diff) |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 137 | } |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 138 | printf("} ATTRIBUTE_PACKED ") |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 139 | } else if (special == "union_type") { |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 140 | print "union {" |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 141 | for (i = 1; i <= parents_cnt; i += 1) { |
| 142 | if (array_parents[aparents_keys[i]] == what_idx) { |
| 143 | returned = what_is(aparents_keys[i]) |
| 144 | printf("%s%s;\n", array[aparents_keys[i], "name"], returned) |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 145 | } |
| 146 | } |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 147 | printf("} ") |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 148 | returned_size = array_get(what_idx, "byte_size") |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 149 | } else if (special == "typedef") { |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 150 | type_idx = array_get(what_idx, "type") |
Dmitry V. Levin | 54d18a2 | 2015-12-15 03:35:26 +0000 | [diff] [blame] | 151 | return leave(what_idx, what_is(type_idx)) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 152 | } else if (special == "member") { |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 153 | type_idx = array_get(what_idx, "type") |
Dmitry V. Levin | 54d18a2 | 2015-12-15 03:35:26 +0000 | [diff] [blame] | 154 | return leave(what_idx, what_is(type_idx)) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 155 | } else { |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 156 | type_idx = array_get(what_idx, "type") |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 157 | what_is(type_idx) |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 158 | } |
Dmitry V. Levin | c4afd6d | 2015-12-15 12:58:42 +0000 | [diff] [blame] | 159 | return leave(what_idx, "") |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 160 | } |
| 161 | BEGIN { |
Dmitry V. Levin | cc902e3 | 2016-01-13 02:31:12 +0000 | [diff] [blame] | 162 | match(ARCH_FLAG, /[[:digit:]]+/, temparray) |
| 163 | default_pointer_size = temparray[0] / 8 |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 164 | print "#include <stdint.h>" |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 165 | } |
| 166 | /^<[[:xdigit:]]+>/ { |
| 167 | match($0, /([[:alnum:]]+)><([[:alnum:]]+)/, matches) |
| 168 | level = matches[1] |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 169 | idx = norm_idx(matches[2]) |
| 170 | array[idx, "idx"] = idx |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 171 | parent[level] = idx |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 172 | } |
| 173 | /^DW_AT_data_member_location/ { |
Dmitry V. Levin | d2bcb16 | 2015-12-16 01:25:10 +0000 | [diff] [blame] | 174 | if (!match($0, /\(DW_OP_plus_uconst:[[:space:]]+([[:digit:]]+)\)/, temparray)) |
| 175 | match($0, /([[:digit:]]+)/, temparray) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 176 | array[idx, "location"] = temparray[1] |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 177 | } |
| 178 | /^DW_AT_name/ { |
Elvira Khabirova | a5ffa18 | 2015-11-26 03:03:24 +0300 | [diff] [blame] | 179 | match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \ |
| 180 | temparray) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 181 | array_names[idx] = 1 |
| 182 | array[idx, "name"] = temparray[1] |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 183 | } |
| 184 | /^DW_AT_byte_size/ { |
| 185 | match($0, /[[:digit:]]+/, temparray) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 186 | array[idx, "byte_size"] = temparray[0] |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 187 | } |
| 188 | /^DW_AT_encoding/ { |
| 189 | match($0, /[[:digit:]]+/, temparray) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 190 | array[idx, "encoding"] = temparray[0] |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 191 | } |
| 192 | /^DW_AT_type/ { |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 193 | match($0, /:[[:space:]]+<0x([[:xdigit:]]*)>$/, temparray) |
| 194 | array[idx, "type"] = norm_idx(temparray[1]) |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 195 | } |
| 196 | /^DW_AT_upper_bound/ { |
| 197 | match($0, /[[:digit:]]+/, temparray) |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 198 | update_upper_bound(parent[level - 1], temparray[0] + 1) |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 199 | } |
Dmitry V. Levin | cc902e3 | 2016-01-13 02:31:12 +0000 | [diff] [blame] | 200 | /^DW_AT_count/ { |
| 201 | match($0, /[[:digit:]]+/, temparray) |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 202 | update_upper_bound(parent[level - 1], temparray[0]) |
Dmitry V. Levin | cc902e3 | 2016-01-13 02:31:12 +0000 | [diff] [blame] | 203 | } |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 204 | /^Abbrev Number:[^(]+\(DW_TAG_/ { |
| 205 | if (match($0, /typedef|union_type|structure_type|pointer_type\ |
| 206 | |enumeration_type|array_type|base_type|member/, temparray)) { |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 207 | array_special[idx] = temparray[0] |
| 208 | array[idx, "special"] = temparray[0] |
Dmitry V. Levin | cc902e3 | 2016-01-13 02:31:12 +0000 | [diff] [blame] | 209 | if ("pointer_type" == temparray[0]) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 210 | array[idx, "byte_size"] = default_pointer_size |
Dmitry V. Levin | cc902e3 | 2016-01-13 02:31:12 +0000 | [diff] [blame] | 211 | if (level > 1 && "member" == temparray[0]) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 212 | array_parents[idx] = parent[level-1] |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 213 | } |
| 214 | } |
| 215 | END { |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 216 | parents_cnt = asorti(array_parents, aparents_keys) |
| 217 | |
| 218 | for (item in array_special) { |
| 219 | if (array[item, "special"] == "pointer_type") { |
| 220 | mpers_ptr_t = \ |
| 221 | "uint" 8 * array_get(item, "byte_size") "_t" |
| 222 | print "#ifndef mpers_ptr_t_is_" mpers_ptr_t |
| 223 | print "typedef " mpers_ptr_t " mpers_ptr_t;" |
| 224 | print "#define mpers_ptr_t_is_" mpers_ptr_t |
| 225 | print "#endif" |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 226 | break |
| 227 | } |
| 228 | } |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 229 | for (item in array_names) { |
| 230 | if (array[item, "name"] == VAR_NAME) { |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 231 | type = array_get(item, "type") |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 232 | print "typedef" |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 233 | what_is(type) |
| 234 | name = array_get(type, "name") |
| 235 | print ARCH_FLAG "_" name ";" |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 236 | print "#define MPERS_" \ |
Dmitry V. Levin | 5999218 | 2015-12-15 00:26:46 +0000 | [diff] [blame] | 237 | ARCH_FLAG "_" name " " \ |
| 238 | ARCH_FLAG "_" name |
Elvira Khabirova | 0929422 | 2015-08-04 01:47:02 +0300 | [diff] [blame] | 239 | break |
| 240 | } |
| 241 | } |
| 242 | } |