From 8c9ad87af2a04bdbe04872441a7bda2ae385a493 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 4 Oct 2005 21:56:53 +0000 Subject: r10720: Add helper function that does prs alignment on a specified number of bytes. (This used to be commit 4576e6843b67c5919823307a196b1582b78fdeaf) --- source3/rpc_parse/parse_prs.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/rpc_parse') 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) ********************************************************************/ -- cgit