r10720: Add helper function that does prs alignment on a specified number of bytes.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 4 Oct 2005 21:56:53 +0000 (21:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:04:50 +0000 (11:04 -0500)
source/rpc_parse/parse_prs.c

index d174bad444d7714e181088ecd3e29aae812880bf..088c8f08fbe3398ea8b1291b2baba96fad7fdec6 100644 (file)
@@ -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)
  ********************************************************************/