summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-23 18:57:07 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-23 18:57:07 +0000
commit7bd8fd1a102045de38e0e0471e2cf7e2aee47eda (patch)
tree4292a09ba448e990eb96b71d4f3e6587cb0d6bcb /source3/lib
parent4c4af2ba5ec3c1496576fe88331346cc631699e5 (diff)
downloadsamba-7bd8fd1a102045de38e0e0471e2cf7e2aee47eda.tar.gz
samba-7bd8fd1a102045de38e0e0471e2cf7e2aee47eda.tar.bz2
samba-7bd8fd1a102045de38e0e0471e2cf7e2aee47eda.zip
adding svcctl 0x1b function
(This used to be commit d5869df3716fec21d3a4237dbf5d2417d3350e11)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_array.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/lib/util_array.c b/source3/lib/util_array.c
index 8df9079e7e..5edb6ebf32 100644
--- a/source3/lib/util_array.c
+++ b/source3/lib/util_array.c
@@ -77,6 +77,34 @@ char* add_chars_to_array(uint32 *len, char ***array, const char *name)
}
+static uint32 *uint32_dup(const uint32* from)
+{
+ if (from != NULL)
+ {
+ uint32 *copy = (uint32 *)malloc(sizeof(uint32));
+ if (copy != NULL)
+ {
+ memcpy(copy, from, sizeof(*copy));
+ }
+ return copy;
+ }
+ return NULL;
+}
+
+void free_uint32_array(uint32 num_entries, uint32 **entries)
+{
+ void(*fn)(void*) = (void(*)(void*))&free;
+ free_void_array(num_entries, (void**)entries, *fn);
+}
+
+uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name)
+{
+ void*(*fn)(const void*) = (void*(*)(const void*))&uint32_dup;
+ return (uint32*)add_item_to_array(len,
+ (void***)array, (const void*)name, *fn, False);
+
+}
+
void free_unistr_array(uint32 num_entries, UNISTR2 **entries)
{
void(*fn)(void*) = (void(*)(void*))&unistr2_free;