diff options
author | Luke Leighton <lkcl@samba.org> | 2000-05-27 01:21:27 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-05-27 01:21:27 +0000 |
commit | 5c6a7861bf4d371a16eb51e0f3a512e6b405d0b7 (patch) | |
tree | 243ddbe78a2340f018d1e907a5359dc1a006c7d3 /source3/aparser/parsefn.awk | |
parent | a0e1930489523b3c9682e6f90db710553cd70084 (diff) | |
download | samba-5c6a7861bf4d371a16eb51e0f3a512e6b405d0b7.tar.gz samba-5c6a7861bf4d371a16eb51e0f3a512e6b405d0b7.tar.bz2 samba-5c6a7861bf4d371a16eb51e0f3a512e6b405d0b7.zip |
cifs parser.
(This used to be commit 96fd33b8982d4d7ff1eef6f2ef836381d443b143)
Diffstat (limited to 'source3/aparser/parsefn.awk')
-rw-r--r-- | source3/aparser/parsefn.awk | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source3/aparser/parsefn.awk b/source3/aparser/parsefn.awk index 45c41d770b..bff4521ba6 100644 --- a/source3/aparser/parsefn.awk +++ b/source3/aparser/parsefn.awk @@ -6,17 +6,33 @@ function elem_name(v, elem) } function parse_array(f, v, elnum, flags, - LOCAL, type, elem) + LOCAL, type, elem, array_len) { type = elements[elnum, "type"]; elem = elements[elnum, "elem"]; + array_len = elements[elnum, "array_len"]; v["ELEM"] = elem_name(v, elem); v["TYPE"] = type; v["FLAGS"] = flags; - v["ARRAY_LEN"] = elements[elnum, "array_len"]; + v["ARRAY_LEN"] = array_len; - if (type == "wchar") { - print_template(f, "prs_wstring.tpl", v); + if (array_len=="*") { + print_template(f,"prs_array_remainder.tpl", v); + return; + } + + if (type == "wchar" || type == "uint16") { + if (match(array_len,"[0-9]") == 1) { + print_template(f, "prs_wstring_fixed.tpl", v); + } else { + print_template(f, "prs_wstring.tpl", v); + } + } else if (type == "uint8") { + if (match(array_len,"[0-9]") == 1) { + print_template(f, "prs_uint8s_fixed.tpl", v); + } else { + print_template(f, "prs_uint8s.tpl", v); + } } else { print_template(f, "prs_array.tpl", v); } |