summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-04 21:56:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:50 -0500
commit8c9ad87af2a04bdbe04872441a7bda2ae385a493 (patch)
tree51e2e99ea5471013b51b059ef3f4da69f37e4b0c /source3
parentebf8a843754ba02f57b38ae01bf143a242132572 (diff)
downloadsamba-8c9ad87af2a04bdbe04872441a7bda2ae385a493.tar.gz
samba-8c9ad87af2a04bdbe04872441a7bda2ae385a493.tar.bz2
samba-8c9ad87af2a04bdbe04872441a7bda2ae385a493.zip
r10720: Add helper function that does prs alignment on a specified number of bytes.
(This used to be commit 4576e6843b67c5919823307a196b1582b78fdeaf)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_parse/parse_prs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index d174bad444..088c8f08fb 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -511,6 +511,24 @@ BOOL prs_align_uint64(prs_struct *ps)
return ret;
}
+/******************************************************************
+ Align on a specific byte boundary
+ *****************************************************************/
+
+BOOL prs_align_custom(prs_struct *ps, uint8 boundary)
+{
+ BOOL ret;
+ uint8 old_align = ps->align;
+
+ ps->align = boundary;
+ ret = prs_align(ps);
+ ps->align = old_align;
+
+ return ret;
+}
+
+
+
/*******************************************************************
Align only if required (for the unistr2 string mainly)
********************************************************************/