From 1987bff88e01c74d647dd2db4f541ac311537e1a Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 10 May 2013 18:19:12 +0200 Subject: Add utility functions for formatting fully-qualified names Instead of using printf-like functions directly, provide two wrappers that would encapsulate formatting the fully-qualified names. No functional change is present in this patch. --- src/util/util.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/util/util.h') diff --git a/src/util/util.h b/src/util/util.h index bdb04a8f..2f65fa20 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -43,6 +43,7 @@ #include #include +#include "confdb/confdb.h" #include "util/atomic_io.h" #include "util/util_errors.h" #include "util/util_safealign.h" @@ -365,6 +366,21 @@ errno_t sss_get_cased_name_list(TALLOC_CTX *mem_ctx, const char * const *orig, bool case_sensitive, const char ***_cased); +/* Return fully-qualified name according to the fq_fmt. The name is allocated using + * talloc on top of mem_ctx + */ +char * +sss_tc_fqname(TALLOC_CTX *mem_ctx, struct sss_names_ctx *nctx, + struct sss_domain_info *domain, const char *name); + +/* Return fully-qualified name formatted according to the fq_fmt. The buffer in "str" is + * "size" bytes long. Returns the number of bytes written on success or a negative + * value of failure. + */ +int +sss_fqname(char *str, size_t size, struct sss_names_ctx *nctx, + struct sss_domain_info *domain, const char *name); + /* from backup-file.c */ int backup_file(const char *src, int dbglvl); -- cgit