Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
util.h File Reference
`#include "ruby/defines.h"`
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros
#define | scan_oct(s, l, e) ((int)ruby_scan_oct((s),(l),(e)))
#define | scan_hex(s, l, e) ((int)ruby_scan_hex((s),(l),(e)))
#define | setenv(name, val) ruby_setenv((name),(val))
#define | unsetenv(name, val) ruby_unsetenv(name)
#define | strdup(s) ruby_strdup(s)
#define | my_getcwd() ruby_getcwd()
#define | strtod(s, e) ruby_strtod((s),(e))

## Functions
unsigned long | ruby_scan_oct (const char *, size_t, size_t *)
unsigned long | ruby_scan_hex (const char *, size_t, size_t *)
void | ruby_qsort (void *, const size_t, const size_t, int(*)(const void *, const void *, void *), void *)
void | ruby_setenv (const char *, const char *)
void | ruby_unsetenv (const char *)
char * | ruby_strdup (const char *)
char * | ruby_getcwd (void)
double | ruby_strtod (const char *, char **)
void | ruby_each_words (const char *, void(*)(const char *, int, void *), void *)

## Macro Definition Documentation

#define my_getcwd | ( |  | ) | ruby_getcwd()

Definition at line 72 of file util.h.

Referenced by load_path_getcwd(), path_check_0(), rb_dir_getwd(), rb_execarg_run_options(), and rb_file_expand_path_internal().

#define scan_hex | ( |  | s,
|  |  | l,
|  |  | e
| ) |  | ((int)ruby_scan_hex((s),(l),(e)))

Definition at line 54 of file util.h.

Referenced by parser_tok_hex(), parser_tokadd_utf8(), and read_escaped_byte().

#define scan_oct | ( |  | s,
|  |  | l,
|  |  | e
| ) |  | ((int)ruby_scan_oct((s),(l),(e)))

Definition at line 52 of file util.h.

Referenced by parser_read_escape(), proc_options(), and read_escaped_byte().

#define setenv | ( |  | name,
|  |  | val
| ) |  | ruby_setenv((name),(val))

Definition at line 64 of file util.h.

Referenced by ruby_setenv().

#define strdup | ( |  | s | ) | ruby_strdup(s)

Definition at line 69 of file util.h.

Referenced by argf_inplace_mode_set(), cState_array_nl_set(), cState_indent_set(), cState_object_nl_set(), cState_space_before_set(), cState_space_set(), dln_find_exe_r(), dln_load(), enc_dup_name(), enc_register_at(), enc_set_default_encoding(), if(), init_env(), insert(), mSyslog_open(), rb_dlcfunc_initialize(), rb_dlcfunc_new(), rb_w32_cmdvector(), readline_attempted_completion_function(), ruby_set_inplace_mode(), yaml_strdup(), and zone_str_update().

#define strtod | ( |  | s,
|  |  | e
| ) |  | ruby_strtod((s),(e))

Definition at line 76 of file util.h.

Referenced by BigDecimal_to_f(), parser_yylex(), r_object0(), and rb_cstr_to_dbl().

#define unsetenv | ( |  | name,
|  |  | val
| ) |  | ruby_unsetenv(name)

Definition at line 65 of file util.h.

Referenced by ruby_setenv().

## Function Documentation

void ruby_each_words | ( | const char * | ,
|  | void(*)(const char *, int, void *) | ,
|  | void * |
| ) |  |

Definition at line 3764 of file util.c.

References arg, end, int, ISSPACE, len, and str.

Referenced by proc_options(), and ruby_set_debug_option().

char* ruby_getcwd | ( | void |  | ) |

Definition at line 475 of file util.c.

References buf, errno, PATH_MAX, rb_sys_fail(), size, xfree, xmalloc, and xrealloc.

void ruby_qsort | ( | void * | ,
|  | const size_t | ,
|  | const size_t | ,
|  | int(*)(const void *, const void *, void *) | ,
|  | void * |
| ) |  |

Referenced by enum_sort_by(), and rb_ary_sort_bang().

unsigned long ruby_scan_hex | ( | const char * | ,
|  | size_t | ,
|  | size_t * |
| ) |  |

Definition at line 42 of file util.c.

References int, retval, s, strchr(), and tmp.

Referenced by unescape_unicode_bmp(), and unescape_unicode_list().

unsigned long ruby_scan_oct | ( | const char * | ,
|  | size_t | ,
|  | size_t * |
| ) |  |

Definition at line 28 of file util.c.

References int, retval, and s.

Referenced by parser_tokadd_escape(), and unescape_nonascii().

void ruby_setenv | ( | const char * | ,
|  | const char * |
| ) |  |

Definition at line 2388 of file hash.c.

References ALLOC_N, buf, envix(), errno, fail, free, GET_ENVIRON, i, len, malloc(), max(), origenviron, rb_sprintf(), rb_str_resize(), rb_sys_fail(), REALLOC_N, RSTRING_PTR, ruby_strdup(), setenv, snprintf, str, strchr(), strlen(), unsetenv, and xfree.

Referenced by env_aset(), env_delete(), rb_execarg_run_options(), and ruby_unsetenv().

char* ruby_strdup | ( | const char * |  | ) |

Definition at line 454 of file util.c.

References len, memcpy(), strlen(), tmp, and xmalloc.

Referenced by argf_initialize_copy(), compat_init_setproctitle(), features_index_add_single(), load_lock(), register_init_ext(), ruby_setenv(), and yycompile().

double ruby_strtod | ( | const char * | ,
|  | char ** |
| ) |  |

Definition at line 1942 of file util.c.

References Avoid_Underflow, Balloc(), Bcopy, Bfree(), Bias, Big0, Big1, bigtens, Bndry_mask, Bndry_mask1, c, cmp(), d2b(), DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, diff(), dval, e, Emin, errno, Exp_1, Exp_mask, Exp_msk1, Exp_shift, FLT_RADIX, Flt_Rounds, Frac_mask, i, i2b(), IEEE_Arith, int, ISDIGIT, Bigint::k, Log2P, LSB, lshift(), match(), mult(), n_bigtens, nf, NULL, P, pow5mult(), ratio(), ret, rounded_product, rounded_quotient, Rounding, s, s2b(), Scale_Bit, Bigint::sign, strchr(), Ten_pmax, tens, Tiny0, Tiny1, tinytens, ulp(), Bigint::wds, word0, word1, and Bigint::x.

void ruby_unsetenv | ( | const char * |  | ) |

Definition at line 2500 of file hash.c.

References ruby_setenv().