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

ruby.c File Reference

#include "ruby.h"
#include "dln.h"
#include "node.h"
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <unistd.h>
#include "util.h"

Go to the source code of this file.

Data Structures

struct  req_list

Defines

#define STATIC_FILE_LENGTH   255
#define rubylib_mangled_path(s, l)   rb_str_new((s), (l))
#define rubylib_mangled_path2(s)   rb_str_new2(s)
#define RUBY_RELATIVE(path)   (path)

Functions

void load_stdin (void)
void load_file (const char *, int)
void forbid_setid (const char *)
void usage (char *name) const
void ruby_incpush (char *path) const
void ruby_init_loadpath ()
void add_modules (char *mod) const
void Init_ext (void)
void require_libraries ()
void process_sflag ()
void proc_options (int argc, char **argv)
char * moreswitches (char *s)
void load_file (char *fname, int script) const
void rb_load_file (char *fname) const
void set_arg0space ()
void set_arg0 (VALUE val, ID id)
void ruby_script (char *name) const
void init_ids ()
void forbid_setid (char *s) const
void verbose_setter (VALUE val, ID id, VALUE *variable)
void ruby_prog_init ()
void ruby_set_argv (int argc, char **argv)
void ruby_process_options (int argc, char **argv)

Variables

VALUE ruby_debug = Qfalse
VALUE ruby_verbose = Qfalse
int sflag = 0
int xflag = 0
int ruby_yydebug
char * ruby_inplace_mode = Qfalse
VALUE do_loop = Qfalse do_print = Qfalse
VALUE do_check = Qfalse do_line = Qfalse
VALUE do_split = Qfalse
char * script
int origargc
char ** origargv
VALUE rb_load_path
req_list req_list_head * req_list_last = &req_list_head
int ruby__end__seen
VALUE rb_progname
VALUE rb_argv
VALUE rb_argv0
struct {
   char *   begin
   char *   end
envspace
char ** environ
int uid
int euid
int gid
int egid


Define Documentation

#define RUBY_RELATIVE path   )     (path)
 

Referenced by ruby_init_loadpath().

#define rubylib_mangled_path s,
 )     rb_str_new((s), (l))
 

Definition at line 170 of file ruby.c.

Referenced by ruby_incpush().

#define rubylib_mangled_path2  )     rb_str_new2(s)
 

Definition at line 171 of file ruby.c.

Referenced by ruby_incpush().

#define STATIC_FILE_LENGTH   255
 

Definition at line 112 of file ruby.c.


Function Documentation

void add_modules char *  mod  )  const [static]
 

Definition at line 319 of file ruby.c.

References ALLOC, ALLOC_N, req_list::next, and req_list_last.

Referenced by proc_options().

void forbid_setid char *  s  )  const [static]
 

Definition at line 1106 of file ruby.c.

References egid, euid, gid, rb_eSecurityError, rb_raise(), rb_safe_level, and uid.

Referenced by load_file(), load_stdin(), and proc_options().

void forbid_setid const char *   )  [static]
 

void Init_ext void   ) 
 

Definition at line 2 of file dmyext.c.

Referenced by require_libraries().

void init_ids  )  [static]
 

Definition at line 1090 of file ruby.c.

References egid, euid, gid, rb_set_safe_level(), and uid.

Referenced by ruby_prog_init().

void load_file char *  fname,
int  script
const [static]
 

Definition at line 834 of file ruby.c.

References ALLOCA_N, forbid_setid(), INT2FIX, ISSPACE, MEMCPY, moreswitches(), NIL_P, NULL, origargc, origargv, Qfalse, rb_compile_file(), rb_define_global_const(), rb_eLoadError, rb_fatal(), rb_file_open(), rb_gc(), rb_io_binmode(), rb_io_close(), rb_io_getc(), rb_io_gets(), rb_io_ungetc(), rb_load_fail(), rb_raise(), rb_source_filename(), rb_stdin, require_libraries(), RSTRING, ruby__end__seen, ruby_parser_stack_on_heap(), ruby_sourcefile, ruby_sourceline, script, strcasecmp(), strrchr(), strstr(), VALUE, and xflag.

Referenced by load_stdin(), proc_options(), and rb_load_file().

void load_file const char *  ,
int 
[static]
 

void load_stdin void   )  [static]
 

Definition at line 964 of file ruby.c.

References forbid_setid(), and load_file().

Referenced by proc_options().

char* moreswitches char *  s  )  [static]
 

Definition at line 434 of file ruby.c.

References ALLOCA_N, ISSPACE, and proc_options().

Referenced by load_file(), and proc_options().

void proc_options int  argc,
char **  argv
[static]
 

Definition at line 454 of file ruby.c.

References add_modules(), dln_find_file(), do_check, do_loop, do_split, FL_TAINT, FL_UNSET, forbid_setid(), free, getenv(), ISPRINT, ISSPACE, load_file(), load_stdin(), moreswitches(), NEW_NEWLINE, NODE, OBJ_TAINT, origargv, PATH_ENV, process_sflag(), Qfalse, Qnil, Qtrue, rb_argv, rb_compile_string(), rb_eRuntimeError, rb_fatal(), rb_fs, rb_load_path, rb_output_rs, rb_raise(), rb_reg_new(), rb_rs, rb_safe_level, rb_set_kcode(), rb_set_safe_level(), rb_source_filename(), rb_str_cat2(), rb_str_new(), rb_str_new2(), require_libraries(), ruby_debug, ruby_incpush(), ruby_init_loadpath(), ruby_inplace_mode, ruby_script(), ruby_set_argv(), ruby_show_copyright(), ruby_show_version(), ruby_sourcefile, ruby_verbose, ruby_yydebug, scan_oct, script, sflag, strchr(), strdup, usage(), VALUE, and xflag.

Referenced by moreswitches(), and ruby_process_options().

void process_sflag  )  [static]
 

Definition at line 373 of file ruby.c.

References args, ISALNUM, Qfalse, Qtrue, RARRAY, rb_argv, rb_ary_shift(), rb_class_new_instance(), rb_eNameError, rb_exc_raise(), rb_gv_set(), rb_str_cat(), rb_str_cat2(), rb_str_new2(), sflag, strchr(), StringValuePtr, and VALUE.

Referenced by proc_options().

void rb_load_file char *  fname  )  const
 

Definition at line 957 of file ruby.c.

References load_file().

Referenced by rb_load().

void require_libraries  )  [static]
 

Definition at line 335 of file ruby.c.

References free, Init_ext(), NEW_NEWLINE, NODE, rb_gc_force_recycle(), rb_jump_tag(), rb_protect(), rb_require(), req_list_last, ruby_current_node, ruby_eval_tree, ruby_eval_tree_begin, ruby_set_current_source(), and VALUE.

Referenced by load_file(), and proc_options().

void ruby_incpush char *  path  )  const
 

Definition at line 175 of file ruby.c.

References PATH_SEP_CHAR, rb_ary_concat(), rb_ary_new(), rb_ary_push(), rb_load_path, rubylib_mangled_path, rubylib_mangled_path2, strchr(), and VALUE.

Referenced by proc_options(), and ruby_init_loadpath().

void ruby_script char *  name  )  const
 

Definition at line 1078 of file ruby.c.

References name, rb_progname, rb_source_filename(), rb_tainted_str_new2(), and ruby_sourcefile.

Referenced by proc_options(), and ruby_process_options().

void set_arg0 VALUE  val,
ID  id
[static]
 

Definition at line 1002 of file ruby.c.

References envspace, ID, NULL, origargc, origargv, rb_eRuntimeError, rb_progname, rb_raise(), rb_tainted_str_new(), rb_tainted_str_new2(), RSTRING, ruby_setenv(), StringValue, and VALUE.

Referenced by ruby_prog_init().

void set_arg0space  )  [static]
 

Definition at line 981 of file ruby.c.

References environ, envspace, and NULL.

Referenced by ruby_process_options().

void usage char *  name  )  const [static]
 

Definition at line 71 of file ruby.c.

References name, and NULL.

Referenced by proc_options().

void verbose_setter VALUE  val,
ID  id,
VALUE variable
[static]
 

Definition at line 1118 of file ruby.c.

References ID, Qtrue, RTEST, ruby_verbose, and VALUE.

Referenced by ruby_prog_init().


Variable Documentation

char* begin
 

Definition at line 976 of file ruby.c.

VALUE do_check = Qfalse do_line = Qfalse [static]
 

Definition at line 62 of file ruby.c.

Referenced by proc_options(), and ruby_process_options().

VALUE do_loop = Qfalse do_print = Qfalse [static]
 

Definition at line 61 of file ruby.c.

Referenced by proc_options(), and ruby_process_options().

VALUE do_split = Qfalse [static]
 

Definition at line 63 of file ruby.c.

Referenced by proc_options(), ruby_process_options(), and ruby_prog_init().

int egid [static]
 

Definition at line 1087 of file ruby.c.

Referenced by forbid_setid(), and init_ids().

char * end
 

Definition at line 976 of file ruby.c.

Referenced by block_append(), calculate_must_string(), int_dotimes(), int_downto(), int_upto(), lex_get_str(), num_step(), pack_unpack(), print_partial_compiled_pattern(), range_each(), range_include(), range_init(), range_initialize(), range_step(), rb_ary_compact_bang(), rb_ary_fill(), rb_clear_cache(), rb_clear_cache_by_class(), rb_clear_cache_by_id(), rb_clear_cache_for_undef(), rb_cstr_to_dbl(), rb_cstr_to_inum(), rb_eval(), rb_f_sleep(), rb_f_sprintf(), rb_gc_mark_locations(), rb_range_beg_len(), rb_range_new(), rb_reg_nth_match(), rb_str_split_m(), rb_str_subpat_set(), rb_str_upto(), rb_str_upto_m(), re_compile_fastmap(), and set_list_bits().

char** environ
 

Definition at line 978 of file ruby.c.

struct { ... } envspace [static]
 

Referenced by set_arg0(), and set_arg0space().

int euid [static]
 

Definition at line 1087 of file ruby.c.

Referenced by forbid_setid(), and init_ids().

int gid [static]
 

Definition at line 1087 of file ruby.c.

Referenced by forbid_setid(), and init_ids().

int origargc [static]
 

Definition at line 67 of file ruby.c.

Referenced by load_file(), ruby_process_options(), and set_arg0().

char** origargv [static]
 

Definition at line 68 of file ruby.c.

Referenced by load_file(), proc_options(), ruby_process_options(), ruby_set_argv(), and set_arg0().

VALUE rb_argv
 

Definition at line 971 of file ruby.c.

VALUE rb_argv0
 

Definition at line 972 of file ruby.c.

VALUE rb_load_path
 

Definition at line 110 of file ruby.c.

Referenced by Init_load(), proc_options(), rb_find_file(), rb_find_file_ext(), and ruby_incpush().

VALUE rb_progname
 

Definition at line 970 of file ruby.c.

Referenced by ruby_process_options(), ruby_prog_init(), ruby_script(), and set_arg0().

struct req_list req_list_head* req_list_last = &req_list_head [static]
 

Definition at line 316 of file ruby.c.

Referenced by add_modules(), and require_libraries().

int ruby__end__seen
 

Definition at line 831 of file ruby.c.

Referenced by load_file(), and yycompile().

VALUE ruby_debug = Qfalse
 

Definition at line 49 of file ruby.c.

Referenced by proc_options(), rb_f_sprintf(), rb_longjmp(), rb_thread_start_0(), and ruby_prog_init().

char* ruby_inplace_mode = Qfalse
 

Definition at line 55 of file ruby.c.

Referenced by next_argv(), opt_i_get(), opt_i_set(), and proc_options().

VALUE ruby_verbose = Qfalse
 

Definition at line 50 of file ruby.c.

Referenced by assign(), block_append(), cond0(), marshal_load(), proc_options(), rb_alias(), rb_cvar_get(), rb_cvar_set(), rb_eval(), rb_f_sprintf(), rb_str2cstr(), rb_sys_warning(), rb_warn(), rb_warn_m(), rb_warning(), ruby_prog_init(), verbose_setter(), void_expr0(), and void_stmts().

int ruby_yydebug
 

Definition at line 53 of file ruby.c.

Referenced by proc_options().

char* script [static]
 

Definition at line 65 of file ruby.c.

Referenced by load_file(), and proc_options().

int sflag = 0 [static]
 

Definition at line 51 of file ruby.c.

Referenced by proc_options(), and process_sflag().

int uid [static]
 

Definition at line 1087 of file ruby.c.

Referenced by forbid_setid(), and init_ids().

int xflag = 0 [static]
 

Definition at line 52 of file ruby.c.

Referenced by load_file(), and proc_options().


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