From: Michael Adam Date: Thu, 14 Aug 2008 22:44:14 +0000 (+0200) Subject: Add modules_path() to construct paths to files in MODULESDIR. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ef9da6f4f04b07804b389902862fae0fbbfed13;p=thirdparty%2Fsamba.git Add modules_path() to construct paths to files in MODULESDIR. Michael --- diff --git a/source/include/proto.h b/source/include/proto.h index 7929033f917..db1adb64eec 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -1340,6 +1340,7 @@ char *myhostname(void); char *lock_path(const char *name); char *pid_path(const char *name); char *lib_path(const char *name); +char *modules_path(const char *name); char *data_path(const char *name); char *state_path(const char *name); const char *shlib_ext(void); diff --git a/source/lib/util.c b/source/lib/util.c index 0fdc9956f12..201d87aeb5c 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2602,6 +2602,19 @@ char *lib_path(const char *name) return talloc_asprintf(talloc_tos(), "%s/%s", get_dyn_LIBDIR(), name); } +/** + * @brief Returns an absolute path to a file in the Samba modules directory. + * + * @param name File to find, relative to MODULESDIR. + * + * @retval Pointer to a string containing the full path. + **/ + +char *modules_path(const char *name) +{ + return talloc_asprintf(talloc_tos(), "%s/%s", get_dyn_MODULESDIR(), name); +} + /** * @brief Returns an absolute path to a file in the Samba data directory. *