diff options
author | Luke Leighton <lkcl@samba.org> | 1999-11-23 18:57:07 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-11-23 18:57:07 +0000 |
commit | d5869df3716fec21d3a4237dbf5d2417d3350e11 (patch) | |
tree | b3997ad2c74a08437878d672c43184db56a99640 /source/lib/util_array.c | |
parent | e88e7d529b5bdf32ac3bc71fa8e18f6f2a98c695 (diff) | |
download | samba-d5869df3716fec21d3a4237dbf5d2417d3350e11.tar.gz |
adding svcctl 0x1b function
Diffstat (limited to 'source/lib/util_array.c')
-rw-r--r-- | source/lib/util_array.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/lib/util_array.c b/source/lib/util_array.c index 8df9079e7e0..5edb6ebf329 100644 --- a/source/lib/util_array.c +++ b/source/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; |