Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

dln.c File Reference

#include "ruby.h"
#include "dln.h"
#include <stdlib.h>
#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <unistd.h>
#include <dlfcn.h>

Go to the source code of this file.

Defines

#define S_ISDIR(m)   ((m & S_IFMT) == S_IFDIR)
#define MAXPATHLEN   1024
#define USE_DLN_DLOPEN
#define FUNCNAME_PATTERN   "Init_%s"
#define init_funcname(buf, file)
#define DLN_ERROR()   (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
#define DLN_DEFINED
#define RTLD_LAZY   1
#define RTLD_GLOBAL   0

Functions

char * getenv ()
int eaccess ()
int init_funcname_len (char **buf, const char *file)
const char * dln_strerror ()
void * dln_load (char *file) const
char * dln_find_1 ()
char * dln_find_exe (char *fname, const char *path) const
char * dln_find_file (char *fname, const char *path) const
char * dln_find_1 (char *fname, char *path, int exe_flag)

Variables

char fbuf [MAXPATHLEN]


Define Documentation

#define DLN_DEFINED
 

 
#define DLN_ERROR  )     (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
 

Referenced by dln_load().

#define FUNCNAME_PATTERN   "Init_%s"
 

Definition at line 105 of file dln.c.

Referenced by init_funcname_len().

#define init_funcname buf,
file   ) 
 

Value:

do {\
    int len = init_funcname_len(buf, file);\
    char *tmp = ALLOCA_N(char, len+1);\
    if (!tmp) {\
        free(*buf);\
        rb_memerror();\
    }\
    strcpy(tmp, *buf);\
    free(*buf);\
    *buf = tmp;\
} while (0)

Definition at line 137 of file dln.c.

Referenced by dln_load().

#define MAXPATHLEN   1024
 

Definition at line 65 of file dln.c.

Referenced by dln_load(), and rb_file_expand_path().

#define RTLD_GLOBAL   0
 

Referenced by dln_load().

#define RTLD_LAZY   1
 

Referenced by dln_load().

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

Definition at line 58 of file dln.c.

#define USE_DLN_DLOPEN
 

Definition at line 98 of file dln.c.


Function Documentation

char* dln_find_1 char *  fname,
char *  path,
int  exe_flag
[static]
 

Definition at line 1717 of file dln.c.

References eaccess(), fbuf, getenv(), NULL, PATH_SEP, S_ISDIR, and strchr().

char* dln_find_1  )  [static]
 

Referenced by dln_find_exe(), and dln_find_file().

char* dln_find_exe char *  fname,
const char *  path
const
 

Definition at line 1653 of file dln.c.

References dln_find_1(), getenv(), and PATH_ENV.

char* dln_find_file char *  fname,
const char *  path
const
 

Definition at line 1672 of file dln.c.

References dln_find_1().

void* dln_load char *  file  )  const
 

Definition at line 1283 of file dln.c.

References DLN_ERROR, dln_load(), dln_strerror(), init_funcname, load(), MAXPATHLEN, NULL, rb_eLoadError, rb_loaderror(), rb_notimplement(), rb_raise(), RTLD_GLOBAL, RTLD_LAZY, strerror(), and strrchr().

Referenced by dln_load().

const char* dln_strerror  )  [static]
 

Definition at line 1169 of file dln.c.

References NULL, and strerror().

Referenced by dln_load().

int eaccess  ) 
 

Referenced by dln_find_1(), test_r(), test_w(), and test_x().

char* getenv  ) 
 

Referenced by dir_s_chdir(), dln_find_1(), dln_find_exe(), env_delete(), env_fetch(), env_has_key(), env_indexes(), env_shift(), file_expand_path(), proc_options(), rb_env_path_tainted(), rb_f_getenv(), and ruby_init_loadpath().

int init_funcname_len char **  buf,
const char *  file
[static]
 

Definition at line 110 of file dln.c.

References FUNCNAME_PATTERN, snprintf(), and xmalloc.


Variable Documentation

char fbuf[MAXPATHLEN] [static]
 

Definition at line 1714 of file dln.c.

Referenced by dln_find_1().


Generated on Wed Jan 18 23:32:08 2006 for Ruby by doxygen 1.3.5