r4327: add usefull function if you don't want that the data will talloc_memdup()'ed
authorStefan Metzmacher <metze@samba.org>
Tue, 21 Dec 2004 15:15:49 +0000 (15:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:07:35 +0000 (13:07 -0500)
metze
(This used to be commit 1f01e370b192fc8fa51eb3a46e7b45c993aa9b80)

source4/lib/data_blob.c

index 15518799335f57ebd296bcff683d96b672e7da18..18ecc2793ac7e14eab1dc417ee70fcedb391065a 100644 (file)
@@ -173,3 +173,10 @@ DATA_BLOB data_blob_string_const(const char *str)
        return blob;
 }
 
        return blob;
 }
 
+DATA_BLOB data_blob_const(const void *p, size_t length)
+{
+       DATA_BLOB blob;
+       blob.data = discard_const(p);
+       blob.length = length;
+       return blob;
+}