diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-16 12:43:53 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-16 12:43:53 +0000 |
commit | 128026c9a2de83a8ac6214e733fa871440c6b77f (patch) | |
tree | fca86e76f0020a2b16549cb0ab2a9dae29d61ac6 /source3/aparser/parsefn.awk | |
parent | f3a3a05ade784ff6906e5c8b132c9440a8db44e5 (diff) | |
download | samba-128026c9a2de83a8ac6214e733fa871440c6b77f.tar.gz samba-128026c9a2de83a8ac6214e733fa871440c6b77f.tar.bz2 samba-128026c9a2de83a8ac6214e733fa871440c6b77f.zip |
added the ".trailer" type, to mark where a packet turns into a trailer
this now gives us enough to parse complete function calls, including
the return values
(This used to be commit ca8f1e92adf3603ad15f73277576cc9178bb4d74)
Diffstat (limited to 'source3/aparser/parsefn.awk')
-rw-r--r-- | source3/aparser/parsefn.awk | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/aparser/parsefn.awk b/source3/aparser/parsefn.awk index 68f08618a6..3f1e3e8093 100644 --- a/source3/aparser/parsefn.awk +++ b/source3/aparser/parsefn.awk @@ -27,6 +27,7 @@ function parse_element(f, v, elnum, flags, LOCAL, type, elem) { type = elements[elnum, "type"]; + if (substr(type,1,1) == ".") return; elem = elements[elnum, "elem"]; if (elements[elnum,"ptr"] == "") { v["PTR"] = "\\&"; @@ -117,24 +118,33 @@ function parse_buffers(f, v, elnum, flags, } function struct_parser(f, v, struct_num, - LOCAL, i) + LOCAL, i, n1) { v["STRUCTNAME"] = structs[struct_num, "name"]; v["FUNCNAME"] = "io_" v["STRUCTNAME"]; print_template(f, "fn_start.tpl", v); + for (n1=0;n1<structs[struct_num, "num_elems"];n1++) { + if (elements[structs[struct_num, n1], "type"] == ".trailer") break; + } + # first all the structure pointers, scalars and arrays - for (i=0;i<structs[struct_num, "num_elems"];i++) { + for (i=0;i<n1;i++) { parse_scalars(f, v, structs[struct_num, i], "PARSE_SCALARS"); } print_template(f, "fn_mid.tpl", v); # now the buffers - for (i=0;i<structs[struct_num, "num_elems"];i++) { + for (i=0;i<n1;i++) { parse_buffers(f, v, structs[struct_num, i], "PARSE_BUFFERS"); } + # and any trailers + for (i=n1;i<structs[struct_num, "num_elems"];i++) { + parse_buffers(f, v, structs[struct_num, i], "PARSE_SCALARS"); + } + print_template(f, "fn_end.tpl", v); } |