diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-02-28 13:12:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:09 -0500 |
commit | aa04388943fe5d7d8c873a6ee8a4cc9af2491532 (patch) | |
tree | 8073b268875c22e8e0785ddffef42fcf3af3dac1 /source4/lib/util/data_blob.c | |
parent | 4d3cc7384338fe2182a2029c2e6d2fcca2ec8813 (diff) | |
download | samba-aa04388943fe5d7d8c873a6ee8a4cc9af2491532.tar.gz samba-aa04388943fe5d7d8c873a6ee8a4cc9af2491532.tar.bz2 samba-aa04388943fe5d7d8c873a6ee8a4cc9af2491532.zip |
r13752: Add doxyfile and fix formatting of comments. Current output is available at http://samba.org/~jelmer/util-api/
(This used to be commit 90812203df151a5e62394306827c72adfe13c63c)
Diffstat (limited to 'source4/lib/util/data_blob.c')
-rw-r--r-- | source4/lib/util/data_blob.c | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/source4/lib/util/data_blob.c b/source4/lib/util/data_blob.c index c6471fbf54..dfcfaa41ea 100644 --- a/source4/lib/util/data_blob.c +++ b/source4/lib/util/data_blob.c @@ -21,10 +21,15 @@ #include "includes.h" -/******************************************************************* +/** + * @file + * @brief Manipulation of arbitrary data blobs + **/ + +/** construct a data blob, must be freed with data_blob_free() you can pass NULL for p and get a blank data blob -*******************************************************************/ +**/ DATA_BLOB data_blob_named(const void *p, size_t length, const char *name) { DATA_BLOB ret; @@ -48,9 +53,9 @@ DATA_BLOB data_blob_named(const void *p, size_t length, const char *name) return ret; } -/******************************************************************* +/** construct a data blob, using supplied TALLOC_CTX -*******************************************************************/ +**/ DATA_BLOB data_blob_talloc_named(TALLOC_CTX *mem_ctx, const void *p, size_t length, const char *name) { DATA_BLOB ret = data_blob_named(p, length, name); @@ -62,10 +67,10 @@ DATA_BLOB data_blob_talloc_named(TALLOC_CTX *mem_ctx, const void *p, size_t leng } -/******************************************************************* +/** reference a data blob, to the supplied TALLOC_CTX. Returns a NULL DATA_BLOB on failure -*******************************************************************/ +**/ DATA_BLOB data_blob_talloc_reference(TALLOC_CTX *mem_ctx, DATA_BLOB *blob) { DATA_BLOB ret = *blob; @@ -78,11 +83,11 @@ DATA_BLOB data_blob_talloc_reference(TALLOC_CTX *mem_ctx, DATA_BLOB *blob) return ret; } -/******************************************************************* +/** construct a zero data blob, using supplied TALLOC_CTX. use this sparingly as it initialises data - better to initialise yourself if you want specific data in the blob -*******************************************************************/ +**/ DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length) { DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, length); @@ -90,9 +95,9 @@ DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length) return blob; } -/******************************************************************* +/** free a data blob -*******************************************************************/ +**/ void data_blob_free(DATA_BLOB *d) { if (d) { @@ -102,9 +107,9 @@ void data_blob_free(DATA_BLOB *d) } } -/******************************************************************* +/** clear a DATA_BLOB's contents -*******************************************************************/ +**/ void data_blob_clear(DATA_BLOB *d) { if (d->data) { @@ -112,9 +117,9 @@ void data_blob_clear(DATA_BLOB *d) } } -/******************************************************************* +/** free a data blob and clear its contents -*******************************************************************/ +**/ void data_blob_clear_free(DATA_BLOB *d) { data_blob_clear(d); @@ -122,9 +127,9 @@ void data_blob_clear_free(DATA_BLOB *d) } -/******************************************************************* +/** check if two data blobs are equal -*******************************************************************/ +**/ BOOL data_blob_equal(const DATA_BLOB *d1, const DATA_BLOB *d2) { if (d1->length != d2->length) { @@ -142,9 +147,9 @@ BOOL data_blob_equal(const DATA_BLOB *d1, const DATA_BLOB *d2) return False; } -/******************************************************************* +/** print the data_blob as hex string -*******************************************************************/ +**/ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, DATA_BLOB *blob) { int i; @@ -161,10 +166,10 @@ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, DATA_BLOB *blob) return hex_string; } -/* +/** useful for constructing data blobs in test suites, while avoiding const warnings -*/ +**/ DATA_BLOB data_blob_string_const(const char *str) { DATA_BLOB blob; @@ -182,9 +187,9 @@ DATA_BLOB data_blob_const(const void *p, size_t length) } -/* +/** realloc a data_blob -*/ +**/ NTSTATUS data_blob_realloc(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, size_t length) { blob->data = talloc_realloc_size(mem_ctx, blob->data, length); @@ -193,9 +198,9 @@ NTSTATUS data_blob_realloc(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, size_t length) return NT_STATUS_OK; } -/* +/** append some data to a data blob -*/ +**/ NTSTATUS data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const void *p, size_t length) { |