diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-06 07:23:30 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-06 07:23:30 -0400 |
commit | ee5fab0fb9e7694bede1074246379dfead4255f5 (patch) | |
tree | bf5e7c9df3f17f5bf42286b906153cecd1d8031c /devtools | |
parent | 764b8259c6a05484423c2734f5b294246108545b (diff) | |
download | gpsd-ee5fab0fb9e7694bede1074246379dfead4255f5.tar.gz |
Generate structure name properly.
Diffstat (limited to 'devtools')
-rwxr-xr-x | devtools/tablegen.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/devtools/tablegen.py b/devtools/tablegen.py index f3954324..c9be5d68 100755 --- a/devtools/tablegen.py +++ b/devtools/tablegen.py @@ -129,6 +129,7 @@ def make_driver_code(wfp): def make_structure(wfp): # Write a structure definition correponding to the table. + global structname record = after is None baseindent = 8 step = 4 @@ -184,6 +185,10 @@ def make_structure(wfp): if arrayname: inwards -= step print >>wfp, tabify(baseindent + inwards) + "} %s[%s];" % (arrayname, arraydim) + if "->" in structname: + structname = structname.split("->")[1] + if "." in structname: + structname = structname.split(".")[1] print >>wfp, tabify(baseindent) + "} %s;" % structname def make_json_dumper(wfp): |