diff options
author | Steven Danneman <steven.danneman@isilon.com> | 2009-09-08 12:09:39 -0700 |
---|---|---|
committer | Steven Danneman <steven.danneman@isilon.com> | 2009-09-08 13:43:06 -0700 |
commit | 11bd19c0071eb0013bedcfc149199a2f1d4063db (patch) | |
tree | 24f79486ba3bccd23cdd9836ce7a7923f70f2c8b /lib/util/util.h | |
parent | 2b16380a0e22cc455f698e59cd94bfd899c989d0 (diff) | |
download | samba-11bd19c0071eb0013bedcfc149199a2f1d4063db.tar.gz samba-11bd19c0071eb0013bedcfc149199a2f1d4063db.tar.bz2 samba-11bd19c0071eb0013bedcfc149199a2f1d4063db.zip |
lib/util: add unique string generator helper function
Diffstat (limited to 'lib/util/util.h')
-rw-r--r-- | lib/util/util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/util/util.h b/lib/util/util.h index 20050d2f0a..aa9f91ef96 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -192,6 +192,16 @@ _PUBLIC_ char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const c */ _PUBLIC_ char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len); +/** + * Generate an array of unique text strings all of the same length. + * The returned strings will be allocated. + * Returns NULL if the number of unique combinations cannot be created. + * + * Characters used are: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+_-#., + */ +_PUBLIC_ char** generate_unique_strs(TALLOC_CTX *mem_ctx, size_t len, + uint32_t num); + /* The following definitions come from lib/util/dprintf.c */ #if _SAMBA_BUILD_ == 4 |