From 25f31194e5adcf66a8c2599da6be92fff8590d22 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 15 Aug 2008 00:44:14 +0200 Subject: Add modules_path() to construct paths to files in MODULESDIR. Michael (This used to be commit 5ef9da6f4f04b07804b389902862fae0fbbfed13) --- source3/include/proto.h | 1 + source3/lib/util.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/source3/include/proto.h b/source3/include/proto.h index 7929033f91..db1adb64ee 100644 --- a/source3/include/proto.h +++ b/source3/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/source3/lib/util.c b/source3/lib/util.c index 0fdc9956f1..201d87aeb5 100644 --- a/source3/lib/util.c +++ b/source3/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. * -- cgit