Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
dln_find.c File Reference
`#include "dln.h"`
`#include <strings.h>`
`#include <stdio.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
Include dependency graph for dln_find.c:

Go to the source code of this file.

## Macros
#define | dln_notimplement --->>> dln not implemented <<<---
#define | dln_memerror abort
#define | dln_exit exit
#define | dln_warning fprintf
#define | dln_warning_arg stderr,
#define | S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define | MAXPATHLEN 1024
#define | PATHNAME_TOO_LONG()
#define | RETURN_IF(expr) if (expr) return (char *)fname;

## Functions
static void | dln_loaderror (const char *format,...)
char * | getenv ()
static char * | dln_find_1 (const char *fname, const char *path, char *buf, size_t size, int exe_flag)
char * | dln_find_exe_r (const char *fname, const char *path, char *buf, size_t size)
char * | dln_find_file_r (const char *fname, const char *path, char *buf, size_t size)
char * | dln_find_exe (const char *fname, const char *path)
char * | dln_find_file (const char *fname, const char *path)

## Variables
static char | fbuf [MAXPATHLEN]

## Macro Definition Documentation

#define dln_exit exit

Definition at line 23 of file dln_find.c.

#define dln_memerror abort

Definition at line 22 of file dln_find.c.

#define dln_notimplement --->>> dln not implemented <<<---

Definition at line 21 of file dln_find.c.

#define dln_warning fprintf

Definition at line 24 of file dln_find.c.

Referenced by dln_find_1().

#define dln_warning_arg stderr,

Definition at line 25 of file dln_find.c.

Referenced by dln_find_1().

#define MAXPATHLEN 1024

Definition at line 63 of file dln_find.c.

#define PATHNAME_TOO_LONG | ( |  | ) |

Value:
dln_warning(dln_warning_arg pathname_too_long, \
((bp - fbuf) > 100 ? 100 : (int)(bp - fbuf)), fbuf, \
((bp - fbuf) > 100 ? "..." : ""), \
(fnlen > 100 ? 100 : (int)fnlen), fname, \
(fnlen > 100 ? "..." : ""))
dln_warning
#define dln_warning
Definition: dln_find.c:24
dln_warning_arg
#define dln_warning_arg
Definition: dln_find.c:25
fbuf
static char fbuf[MAXPATHLEN]
Definition: dln_find.c:105
bp
#define bp()
Definition: vm_debug.h:27

Referenced by dln_find_1().

#define RETURN_IF | ( |  | expr | ) | if (expr) return (char *)fname;

Referenced by dln_find_1().

#define S_ISDIR | ( |  | m | ) | (((m) & S_IFMT) == S_IFDIR)

Definition at line 56 of file dln_find.c.

Referenced by dln_find_1().

## Function Documentation

static char * dln_find_1 | ( | const char * | fname,
|  | const char * | path,
|  | char * | buf,
|  | size_t | size,
|  | int | exe_flag
| ) |  |
| static

Definition at line 120 of file dln_find.c.

References bp, CharNext, dln_warning, dln_warning_arg, dp, eaccess(), fbuf, getenv(), i, memcpy(), NULL, p, PATH_SEP, PATHNAME_TOO_LONG, RETURN_IF, S_ISDIR, stat, STRCASECMP, strchr(), strlcpy(), strlen(), and X_OK.

Referenced by dln_find_exe_r(), and dln_find_file_r().

char* dln_find_exe | ( | const char * | fname,
|  | const char * | path
| ) |  |

Definition at line 108 of file dln_find.c.

References dln_find_exe_r(), and fbuf.

char* dln_find_exe_r | ( | const char * | fname,
|  | const char * | path,
|  | char * | buf,
|  | size_t | size
| ) |  |

Definition at line 77 of file dln_find.c.

References buf, dln_find_1(), free, getenv(), PATH_ENV, and strdup.

Referenced by dln_find_exe(), proc_exec_cmd(), proc_exec_sh(), proc_exec_v(), rb_exec_fillarg(), rb_w32_aspawn_flags(), and rb_w32_spawn().

char* dln_find_file | ( | const char * | fname,
|  | const char * | path
| ) |  |

Definition at line 114 of file dln_find.c.

References dln_find_file_r(), and fbuf.

char* dln_find_file_r | ( | const char * | fname,
|  | const char * | path,
|  | char * | buf,
|  | size_t | size
| ) |  |

Definition at line 99 of file dln_find.c.

References dln_find_1().

Referenced by dln_find_file(), process_options(), and ruby_init_loadpath_safe().

static void dln_loaderror | ( | const char * | format,
|  |  | ...
| ) |  |
| static

char* getenv | ( |  | ) |

## Variable Documentation

char fbuf[MAXPATHLEN]
| static

Definition at line 105 of file dln_find.c.

Referenced by dln_find_1(), dln_find_exe(), dln_find_file(), proc_exec_cmd(), proc_exec_sh(), proc_exec_v(), process_options(), rb_str_format(), rb_w32_aspawn_flags(), rb_w32_spawn(), and ruby_init_loadpath_safe().