summaryrefslogtreecommitdiffstats
path: root/source/aparser/basic.awk
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-12 14:35:14 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-12 14:35:14 +0000
commit57a6cb52e6c646cd8a3d25f10f65a65e12d22a24 (patch)
tree691f681621f9c6aeb5741b3e76db9752bad17bae /source/aparser/basic.awk
parent7bc87d20ea47ba25851512cc6f9de6076ce1cec8 (diff)
downloadsamba-57a6cb52e6c646cd8a3d25f10f65a65e12d22a24.tar.gz
samba-57a6cb52e6c646cd8a3d25f10f65a65e12d22a24.tar.xz
samba-57a6cb52e6c646cd8a3d25f10f65a65e12d22a24.zip
preliminary support for unions
Diffstat (limited to 'source/aparser/basic.awk')
-rw-r--r--source/aparser/basic.awk43
1 files changed, 43 insertions, 0 deletions
diff --git a/source/aparser/basic.awk b/source/aparser/basic.awk
new file mode 100644
index 00000000000..3dab8a47681
--- /dev/null
+++ b/source/aparser/basic.awk
@@ -0,0 +1,43 @@
+function uint32_parser(elem) {
+ printf("\
+ if(!prs_uint32(\"%s\", ps, depth, &il->%s))\n\
+ return False;\n\
+", elem, elem);
+}
+
+function unistr2_parser(elem) {
+ printf("\
+ if(!prs_uint32(\"%s_ptr\", ps, depth, &il->%s_ptr))\n\
+ return False;\n\
+", elem, elem);
+}
+
+function buffer5_parser(elem) {
+ printf("\
+ if(!prs_uint32(\"%s_len\", ps, depth, &il->%s_len))\n\
+ return False;\n\
+ if(!prs_uint32(\"%s_ptr\", ps, depth, &il->%s_ptr))\n\
+ return False;\n\
+", elem, elem, elem, elem);
+}
+
+function nttime_parser(elem) {
+ printf("\
+ if(!smb_io_time(\"%s\", &il->%s, ps, depth))\n\
+ return False;\n\
+", elem, elem);
+}
+
+function uint64_parser(elem) {
+ printf("\
+ if(!prs_uint64(\"%s\", ps, depth, &il->%s))\n\
+ return False;\n\
+", elem, elem);
+}
+
+function generic_parser(type, elem) {
+ printf("\
+ if(!%s(\"%s\", &il->%s, ps, depth))\n\
+ return False;\n\
+", "io_"tolower(type), elem, elem);
+}