svn commit: samba r18709 - in branches/SAMBA_3_0/source/lib: .
metze at samba.org
metze at samba.org
Wed Sep 20 07:15:42 GMT 2006
Author: metze
Date: 2006-09-20 07:15:42 +0000 (Wed, 20 Sep 2006)
New Revision: 18709
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18709
Log:
add some useful function from samba4
metze
Modified:
branches/SAMBA_3_0/source/lib/data_blob.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/data_blob.c
===================================================================
--- branches/SAMBA_3_0/source/lib/data_blob.c 2006-09-20 02:09:14 UTC (rev 18708)
+++ branches/SAMBA_3_0/source/lib/data_blob.c 2006-09-20 07:15:42 UTC (rev 18709)
@@ -118,3 +118,28 @@
data_blob_clear(d);
data_blob_free(d);
}
+
+/**
+ useful for constructing data blobs in test suites, while
+ avoiding const warnings
+**/
+DATA_BLOB data_blob_string_const(const char *str)
+{
+ DATA_BLOB blob;
+ blob.data = CONST_DISCARD(uint8 *, str);
+ blob.length = strlen(str);
+ blob.free = NULL;
+ return blob;
+}
+
+/**
+ * Create a new data blob from const data
+ */
+DATA_BLOB data_blob_const(const void *p, size_t length)
+{
+ DATA_BLOB blob;
+ blob.data = CONST_DISCARD(uint8 *, p);
+ blob.length = length;
+ blob.free = NULL;
+ return blob;
+}
More information about the samba-cvs
mailing list