updated the 3.0 branch from the head branch - ready for alpha18
[ira/wip.git] / source3 / rpc_parse / parse_prs.c
index 6d65d5cc7f474d9cdf03652e8788fda79ed3eda8..2ab8c7246e19184ce0e9226edded4010d77e175f 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "includes.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_RPC_PARSE
+
 /**
  * Dump a prs to a file: from the current location through to the end.
  **/
@@ -73,7 +76,7 @@ void prs_dump_region(char *name, int v, prs_struct *ps,
  XXXX side-effect of this function is to increase the debug depth XXXX
 
  ********************************************************************/
-void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name)
+void prs_debug(prs_struct *ps, int depth, const char *desc, char *fn_name)
 {
        DEBUG(5+depth, ("%s%06x %s %s\n", tab_depth(depth), ps->data_offset, fn_name, desc));
 }
@@ -444,6 +447,38 @@ BOOL prs_align(prs_struct *ps)
        return True;
 }
 
+/******************************************************************
+ Align on a 2 byte boundary
+ *****************************************************************/
+BOOL prs_align_uint16(prs_struct *ps)
+{
+       BOOL ret;
+       uint8 old_align = ps->align;
+
+       ps->align = 2;
+       ret = prs_align(ps);
+       ps->align = old_align;
+       
+       return ret;
+}
+
+/******************************************************************
+ Align on a 8 byte boundary
+ *****************************************************************/
+BOOL prs_align_uint64(prs_struct *ps)
+{
+       BOOL ret;
+       uint8 old_align = ps->align;
+
+       ps->align = 8;
+       ret = prs_align(ps);
+       ps->align = old_align;
+       
+       return ret;
+}
+
 /*******************************************************************
  Align only if required (for the unistr2 string mainly)
  ********************************************************************/