summaryrefslogtreecommitdiff
path: root/dln_find.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-30 01:58:51 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-30 01:58:51 (GMT)
commit1f500f03685c9e6de1d44e0fef858b066b3cdf8b (patch)
tree03cfdbdc013bf5ea68d2b8a8aa03dd346f8e54be /dln_find.c
parent69bbcbe4c1401f98b5de299c872828d6aeae2f8e (diff)
dln.c: extra arguments
* dln.h (DLN_FIND_EXTRA_ARG, DLN_FIND_EXTRA_ARG_DECL): allow extra arguments to dln_find_{exe,file}_r(). * dln_find.c (dln_find_exe_r, dln_find_file_r): add extract arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln_find.c')
-rw-r--r--dln_find.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/dln_find.c b/dln_find.c
index 3160235..f41ceb0 100644
--- a/dln_find.c
+++ b/dln_find.c
@@ -63,10 +63,12 @@ char *dln_argv0;
char *getenv();
#endif
-static char *dln_find_1(const char *fname, const char *path, char *buf, size_t size, int exe_flag);
+static char *dln_find_1(const char *fname, const char *path, char *buf, size_t size, int exe_flag
+ DLN_FIND_EXTRA_ARG_DECL);
char *
-dln_find_exe_r(const char *fname, const char *path, char *buf, size_t size)
+dln_find_exe_r(const char *fname, const char *path, char *buf, size_t size
+ DLN_FIND_EXTRA_ARG_DECL)
{
char *envpath = 0;
@@ -82,21 +84,23 @@ dln_find_exe_r(const char *fname, const char *path, char *buf, size_t size)
path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:.";
#endif
}
- buf = dln_find_1(fname, path, buf, size, 1);
+ buf = dln_find_1(fname, path, buf, size, 1 DLN_FIND_EXTRA_ARG);
if (envpath) free(envpath);
return buf;
}
char *
-dln_find_file_r(const char *fname, const char *path, char *buf, size_t size)
+dln_find_file_r(const char *fname, const char *path, char *buf, size_t size
+ DLN_FIND_EXTRA_ARG_DECL)
{
if (!path) path = ".";
- return dln_find_1(fname, path, buf, size, 0);
+ return dln_find_1(fname, path, buf, size, 0 DLN_FIND_EXTRA_ARG);
}
static char *
dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
- int exe_flag /* non 0 if looking for executable. */)
+ int exe_flag /* non 0 if looking for executable. */
+ DLN_FIND_EXTRA_ARG_DECL)
{
register const char *dp;
register const char *ep;