Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Enumerations | Functions | Variables
load.c File Reference
#include "internal.h"
#include "ruby/util.h"
#include "dln.h"
#include "eval_intern.h"
#include "probes.h"

Go to the source code of this file.

Data Structures

struct  loaded_feature_searching
 

Macros

#define IS_RBEXT(e)   (strcmp((e), ".rb") == 0)
 
#define IS_SOEXT(e)   (strcmp((e), ".so") == 0 || strcmp((e), ".o") == 0)
 
#define IS_DLEXT(e)   (strcmp((e), DLEXT) == 0)
 
#define rb_intern(str)   rb_intern2((str), strlen(str))
 

Enumerations

enum  expand_type { EXPAND_ALL, EXPAND_RELATIVE, EXPAND_HOME, EXPAND_NON_CACHE }
 

Functions

VALUE rb_get_load_path (void)
 
VALUE rb_get_expanded_load_path (void)
 
int rb_provided (const char *feature)
 
int rb_feature_provided (const char *feature, const char **loading)
 
void rb_provide (const char *feature)
 
 NORETURN (static void load_failed(VALUE))
 
const rb_iseq_trb_iseq_load_iseq (VALUE fname)
 
void rb_load (VALUE fname, int wrap)
 
void rb_load_protect (VALUE fname, int wrap, int *pstate)
 
VALUE rb_f_require (VALUE obj, VALUE fname)
 
VALUE rb_f_require_relative (VALUE obj, VALUE fname)
 
int rb_require_internal (VALUE fname, int safe)
 
int ruby_require_internal (const char *fname, unsigned int len)
 
VALUE rb_require_safe (VALUE fname, int safe)
 
VALUE rb_require (const char *fname)
 
RUBY_FUNC_EXPORTED void ruby_init_ext (const char *name, void(*init)(void))
 
void Init_load (void)
 

Variables

VALUE rb_mWarning
 

Macro Definition Documentation

◆ IS_DLEXT

#define IS_DLEXT (   e)    (strcmp((e), DLEXT) == 0)

Definition at line 18 of file load.c.

◆ IS_RBEXT

#define IS_RBEXT (   e)    (strcmp((e), ".rb") == 0)

Definition at line 13 of file load.c.

Referenced by rb_feature_provided().

◆ IS_SOEXT

#define IS_SOEXT (   e)    (strcmp((e), ".so") == 0 || strcmp((e), ".o") == 0)

Definition at line 14 of file load.c.

◆ rb_intern

#define rb_intern (   str)    rb_intern2((str), strlen(str))

Enumeration Type Documentation

◆ expand_type

Enumerator
EXPAND_ALL 
EXPAND_RELATIVE 
EXPAND_HOME 
EXPAND_NON_CACHE 

Definition at line 36 of file load.c.

Function Documentation

◆ Init_load()

void Init_load ( void  )

Definition at line 1183 of file load.c.

References GET_VM, rb_define_hooked_variable(), and rb_intern2().

◆ NORETURN()

NORETURN ( static void   load_failedVALUE)

◆ rb_f_require()

VALUE rb_f_require ( VALUE  obj,
VALUE  fname 
)

Definition at line 827 of file load.c.

References rb_require_safe(), and rb_safe_level().

◆ rb_f_require_relative()

VALUE rb_f_require_relative ( VALUE  obj,
VALUE  fname 
)

◆ rb_feature_provided()

int rb_feature_provided ( const char *  feature,
const char **  loading 
)

Definition at line 528 of file load.c.

References IS_RBEXT, Qnil, rb_file_expand_path_fast(), rb_get_path(), rb_str_new2, RSTRING_PTR, strchr(), and strrchr().

Referenced by rb_provided().

◆ rb_get_expanded_load_path()

VALUE rb_get_expanded_load_path ( void  )

◆ rb_get_load_path()

VALUE rb_get_load_path ( void  )

Definition at line 30 of file load.c.

References GET_VM.

◆ rb_iseq_load_iseq()

const rb_iseq_t* rb_iseq_load_iseq ( VALUE  fname)

Definition at line 512 of file iseq.c.

References rb_check_funcall(), rb_cISeq, rb_intern, RBASIC_CLASS, and SPECIAL_CONST_P.

◆ rb_load()

void rb_load ( VALUE  fname,
int  wrap 
)

Definition at line 665 of file load.c.

◆ rb_load_protect()

void rb_load_protect ( VALUE  fname,
int  wrap,
int *  pstate 
)

Definition at line 671 of file load.c.

References EXEC_TAG, PUSH_TAG, and TAG_NONE.

◆ rb_provide()

void rb_provide ( const char *  feature)

Definition at line 572 of file load.c.

◆ rb_provided()

int rb_provided ( const char *  feature)

Definition at line 522 of file load.c.

References rb_feature_provided().

◆ rb_require()

VALUE rb_require ( const char *  fname)

◆ rb_require_internal()

int rb_require_internal ( VALUE  fname,
int  safe 
)

◆ rb_require_safe()

VALUE rb_require_safe ( VALUE  fname,
int  safe 
)

◆ ruby_init_ext()

RUBY_FUNC_EXPORTED void ruby_init_ext ( const char *  name,
void(*)(void)  init 
)

Definition at line 1083 of file load.c.

◆ ruby_require_internal()

int ruby_require_internal ( const char *  fname,
unsigned int  len 
)