source: mainline/tools/autogen2.awk@ 0aa06cbe

Last change on this file since 0aa06cbe was 5af6cf3d, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 8 years ago

todo

  • Property mode set to 100755
File size: 498 bytes
Line 
1#!/usr/bin/awk -f
2
3/}.*;/ {
4 if (($0 != "};") && ($0 != "} " struct_name "_t;")) {
5 print("Bad struct ending: " $0) > "/dev/stderr"
6 exit 1
7 }
8 print "DEFINE_STRUCT(" struct_name ", " toupper(struct_name) ")"
9 struct_name = ""
10}
11
12/;$/ {
13 if (struct_name != "") {
14 # Remove array subscript, if any.
15 sub("(\\[.*\\])?;", "", $0)
16 member = $NF
17 print "DEFINE_MEMBER(" struct_name ", " toupper(struct_name) ", " member ", " toupper(member) ")"
18 }
19}
20
21/^typedef struct .* \{/ {
22 struct_name = $3
23}
Note: See TracBrowser for help on using the repository browser.