summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-07-21 00:32:09 +0000
committerLuke Leighton <lkcl@samba.org>1999-07-21 00:32:09 +0000
commit6a5a4e818684a616306d2954d1a2612113b314a6 (patch)
treee1900e634df995f0a1d36c063645cd4997a9529f /source3/lib/util.c
parent46ce0d4619839f40f910eb4a0d2c3da01436bc88 (diff)
downloadsamba-6a5a4e818684a616306d2954d1a2612113b314a6.tar.gz
samba-6a5a4e818684a616306d2954d1a2612113b314a6.tar.bz2
samba-6a5a4e818684a616306d2954d1a2612113b314a6.zip
BDC support.
(This used to be commit 2331aa32ab36c3ee5fd8cfbe972e57299939e33d)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 8a9452ee00..9a4d0d9e25 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2931,6 +2931,33 @@ void out_ascii(FILE *f, unsigned char *buf,int len)
}
}
+void out_struct(FILE *f,char *buf1,int len, int per_line)
+{
+ unsigned char *buf = (unsigned char *)buf1;
+ int i;
+
+ if (len<=0)
+ {
+ return;
+ }
+
+ fprintf(f, "{\n\t");
+ for (i=0;i<len;)
+ {
+ fprintf(f, "0x%02X",(int)buf[i]);
+ i++;
+ if (i != len)
+ {
+ fprintf(f, ", ");
+ }
+ if (i%per_line == 0 && i != len)
+ {
+ fprintf(f, "\n\t");
+ }
+ }
+ fprintf(f, "\n};\n");
+}
+
void out_data(FILE *f,char *buf1,int len, int per_line)
{
unsigned char *buf = (unsigned char *)buf1;