Ruby  2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
Data Structures | Macros | Typedefs | Enumerations | Functions
load.c File Reference
#include "ruby/encoding.h"
#include "ruby/util.h"
#include "internal.h"
#include "dln.h"
#include "eval_intern.h"
#include "probes.h"
#include "iseq.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))
 

Typedefs

typedef int(* feature_func) (const char *feature, const char *ext, int rb, int expanded, const char **fn)
 

Enumerations

enum  expand_type { EXPAND_ALL, EXPAND_RELATIVE, EXPAND_HOME, EXPAND_NON_CACHE }
 

Functions

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))
 
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)
 
VALUE rb_resolve_feature_path (VALUE klass, VALUE fname)
 
int rb_require_internal (VALUE fname)
 
int ruby_require_internal (const char *fname, unsigned int len)
 
VALUE rb_require_safe (VALUE fname, int safe)
 
VALUE rb_require_string (VALUE fname)
 
VALUE rb_require (const char *fname)
 
RUBY_FUNC_EXPORTED void ruby_init_ext (const char *name, void(*init)(void))
 
void Init_load (void)
 

Macro Definition Documentation

◆ IS_DLEXT

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

Definition at line 20 of file load.c.

◆ IS_RBEXT

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

Definition at line 15 of file load.c.

◆ IS_SOEXT

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

Definition at line 16 of file load.c.

◆ rb_intern

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

Typedef Documentation

◆ feature_func

typedef int(* feature_func) (const char *feature, const char *ext, int rb, int expanded, const char **fn)

Definition at line 833 of file load.c.

Enumeration Type Documentation

◆ expand_type

Enumerator
EXPAND_ALL 
EXPAND_RELATIVE 
EXPAND_HOME 
EXPAND_NON_CACHE 

Definition at line 31 of file load.c.

Function Documentation

◆ Init_load()

void Init_load ( void  )

◆ NORETURN()

NORETURN ( static void   load_failedVALUE)

◆ rb_f_require()

VALUE rb_f_require ( VALUE  obj,
VALUE  fname 
)

Definition at line 809 of file load.c.

References rb_require_string().

◆ 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 
)

◆ rb_get_expanded_load_path()

VALUE rb_get_expanded_load_path ( void  )

◆ rb_load()

void rb_load ( VALUE  fname,
int  wrap 
)

Definition at line 649 of file load.c.

References FilePathValue, and rb_find_file().

Referenced by rb_load_protect().

◆ rb_load_protect()

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

Definition at line 657 of file load.c.

References EC_EXEC_TAG, EC_POP_TAG, EC_PUSH_TAG, GET_EC, rb_load(), and TAG_NONE.

◆ rb_provide()

void rb_provide ( const char feature)

Definition at line 563 of file load.c.

◆ rb_provided()

int rb_provided ( const char feature)

Definition at line 513 of file load.c.

References rb_feature_provided().

◆ rb_require_internal()

int rb_require_internal ( VALUE  fname)

Definition at line 1066 of file load.c.

References GET_EC.

◆ rb_require_safe()

VALUE rb_require_safe ( VALUE  fname,
int  safe 
)

Definition at line 1084 of file load.c.

References GET_EC, and rb_warn().

◆ rb_require_string()

VALUE rb_require_string ( VALUE  fname)

Definition at line 1101 of file load.c.

References GET_EC.

Referenced by rb_f_require(), rb_f_require_relative(), and rb_require().

◆ rb_resolve_feature_path()

VALUE rb_resolve_feature_path ( VALUE  klass,
VALUE  fname 
)

Definition at line 947 of file load.c.

References path, rb_get_path(), rb_str_encode_ospath(), and sym.

◆ ruby_init_ext()

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

Definition at line 1138 of file load.c.

◆ ruby_require_internal()

int ruby_require_internal ( const char fname,
unsigned int  len 
)

Definition at line 1073 of file load.c.

References GET_EC, len, rb_setup_fake_str(), and str.