Ruby
2.1.10p492(2016-04-01revision54464)
|
Go to the source code of this file.
Macros | |
#define | sizeof_array(o) (sizeof o / sizeof o[0]) |
#define | f_negate(x) rb_funcall(x, rb_intern("-@"), 0) |
#define | f_add(x, y) rb_funcall(x, '+', 1, y) |
#define | f_sub(x, y) rb_funcall(x, '-', 1, y) |
#define | f_mul(x, y) rb_funcall(x, '*', 1, y) |
#define | f_div(x, y) rb_funcall(x, '/', 1, y) |
#define | f_idiv(x, y) rb_funcall(x, rb_intern("div"), 1, y) |
#define | f_mod(x, y) rb_funcall(x, '%', 1, y) |
#define | f_expt(x, y) rb_funcall(x, rb_intern("**"), 1, y) |
#define | f_lt_p(x, y) rb_funcall(x, '<', 1, y) |
#define | f_gt_p(x, y) rb_funcall(x, '>', 1, y) |
#define | f_le_p(x, y) rb_funcall(x, rb_intern("<="), 1, y) |
#define | f_ge_p(x, y) rb_funcall(x, rb_intern(">="), 1, y) |
#define | f_match(r, s) rb_funcall(r, rb_intern("match"), 1, s) |
#define | f_aref(o, i) rb_funcall(o, rb_intern("[]"), 1, i) |
#define | f_end(o, i) rb_funcall(o, rb_intern("end"), 1, i) |
#define | issign(c) ((c) == '-' || (c) == '+') |
#define | NUM_PATTERN_P() num_pattern_p(&fmt[fi + 1]) |
#define | set_hash(k, v) rb_hash_aset(hash, ID2SYM(rb_intern(k)), v) |
#define | ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k))) |
#define | del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k))) |
#define | fail() |
#define | fail_p() (!NIL_P(ref_hash("_fail"))) |
#define | READ_DIGITS(n, w) |
#define | READ_DIGITS_MAX(n) READ_DIGITS(n, LONG_MAX) |
#define | recur(fmt) |
Functions | |
static int | num_pattern_p (const char *s) |
static long | read_digits (const char *s, VALUE *n, size_t width) |
static int | valid_range_p (VALUE v, int a, int b) |
VALUE | date_zone_to_diff (VALUE) |
static size_t | date__strptime_internal (const char *str, size_t slen, const char *fmt, size_t flen, VALUE hash) |
VALUE | date__strptime (const char *str, size_t slen, const char *fmt, size_t flen, VALUE hash) |
Variables | |
static const char * | day_names [] |
static const char * | month_names [] |
static const char * | merid_names [] |
static const char * | extz_pats [] |
#define del_hash | ( | k | ) | rb_hash_delete(hash, ID2SYM(rb_intern(k))) |
Definition at line 116 of file date_strptime.c.
Referenced by date__strptime().
#define f_add | ( | x, | |
y | |||
) | rb_funcall(x, '+', 1, y) |
Definition at line 39 of file date_strptime.c.
Referenced by date__strptime().
#define f_aref | ( | o, | |
i | |||
) | rb_funcall(o, rb_intern("[]"), 1, i) |
Definition at line 53 of file date_strptime.c.
#define f_div | ( | x, | |
y | |||
) | rb_funcall(x, '/', 1, y) |
Definition at line 42 of file date_strptime.c.
#define f_end | ( | o, | |
i | |||
) | rb_funcall(o, rb_intern("end"), 1, i) |
Definition at line 54 of file date_strptime.c.
Referenced by date__strptime_internal().
#define f_expt | ( | x, | |
y | |||
) | rb_funcall(x, rb_intern("**"), 1, y) |
Definition at line 45 of file date_strptime.c.
Referenced by date__strptime_internal().
#define f_ge_p | ( | x, | |
y | |||
) | rb_funcall(x, rb_intern(">="), 1, y) |
Definition at line 50 of file date_strptime.c.
Referenced by date__strptime_internal().
#define f_gt_p | ( | x, | |
y | |||
) | rb_funcall(x, '>', 1, y) |
Definition at line 48 of file date_strptime.c.
Referenced by valid_range_p().
#define f_idiv | ( | x, | |
y | |||
) | rb_funcall(x, rb_intern("div"), 1, y) |
Definition at line 43 of file date_strptime.c.
#define f_le_p | ( | x, | |
y | |||
) | rb_funcall(x, rb_intern("<="), 1, y) |
Definition at line 49 of file date_strptime.c.
#define f_lt_p | ( | x, | |
y | |||
) | rb_funcall(x, '<', 1, y) |
Definition at line 47 of file date_strptime.c.
Referenced by valid_range_p().
#define f_match | ( | r, | |
s | |||
) | rb_funcall(r, rb_intern("match"), 1, s) |
Definition at line 52 of file date_strptime.c.
Referenced by date__strptime_internal().
#define f_mod | ( | x, | |
y | |||
) | rb_funcall(x, '%', 1, y) |
Definition at line 44 of file date_strptime.c.
Referenced by date__strptime().
#define f_mul | ( | x, | |
y | |||
) | rb_funcall(x, '*', 1, y) |
Definition at line 41 of file date_strptime.c.
Referenced by date__strptime().
#define f_negate | ( | x | ) | rb_funcall(x, rb_intern("-@"), 0) |
Definition at line 38 of file date_strptime.c.
Referenced by date__strptime_internal().
#define f_sub | ( | x, | |
y | |||
) | rb_funcall(x, '-', 1, y) |
Definition at line 40 of file date_strptime.c.
#define fail | ( | ) |
Definition at line 118 of file date_strptime.c.
Referenced by allocate_converted_string(), backward_search_range(), date__strptime_internal(), match_at(), output_hex_charref(), rb_econv_insert_output(), ruby_qsort(), ruby_setenv(), and run_exec_dup2().
Definition at line 124 of file date_strptime.c.
Referenced by date__strptime().
Definition at line 56 of file date_strptime.c.
Referenced by date__strptime_internal().
#define NUM_PATTERN_P | ( | ) | num_pattern_p(&fmt[fi + 1]) |
Definition at line 75 of file date_strptime.c.
Referenced by date__strptime_internal().
#define READ_DIGITS | ( | n, | |
w | |||
) |
Definition at line 126 of file date_strptime.c.
Referenced by date__strptime_internal().
#define READ_DIGITS_MAX | ( | n | ) | READ_DIGITS(n, LONG_MAX) |
Definition at line 135 of file date_strptime.c.
Referenced by date__strptime_internal().
#define recur | ( | fmt | ) |
Definition at line 147 of file date_strptime.c.
Referenced by class_instance_method_list(), date__strptime_internal(), rb_mod_const_defined(), rb_mod_const_get(), rb_obj_methods(), and rb_obj_singleton_methods().
#define ref_hash | ( | k | ) | rb_hash_aref(hash, ID2SYM(rb_intern(k))) |
Definition at line 115 of file date_strptime.c.
Referenced by date__strptime().
Definition at line 114 of file date_strptime.c.
Referenced by date__strptime(), and date__strptime_internal().
Definition at line 36 of file date_strptime.c.
Referenced by date__strptime_internal().
Definition at line 649 of file date_strptime.c.
References date__strptime_internal(), del_hash, f_add, f_mod, f_mul, fail_p, hash, INT2FIX, NIL_P(), Qnil, rb_usascii_str_new(), ref_hash, s, and set_hash.
Referenced by date_s__strptime_internal().
|
static |
Definition at line 160 of file date_strptime.c.
References b, c, date_zone_to_diff(), day_names, extz_pats, f_end, f_expt, f_ge_p, f_match, f_negate, fail, i, int, INT2FIX, issign, m, merid_names, month_names, n, NIL_P(), NUM2LONG, NUM_PATTERN_P, ONIG_OPTION_IGNORECASE, pat, Qnil, rb_backref_get(), rb_backref_set(), rb_gc_register_mark_object(), rb_match_busy(), rb_rational_new2, rb_reg_new(), rb_reg_nth_match(), rb_usascii_str_new2, READ_DIGITS, READ_DIGITS_MAX, recur, s, set_hash, sizeof_array, strchr(), strlen(), strncasecmp, ULONG2NUM, and valid_range_p().
Referenced by date__strptime().
Definition at line 420 of file date_parse.c.
References a, ALLOCA_N, b, cstr2num, d, DST, dst, f_add, f_aref, f_expt, f_mul, f_negate, i, int, INT2FIX, issign, LONG2NUM, min(), name, NIL_P(), zone::offset, p, Qnil, RB_GC_GUARD(), rb_gc_register_mark_object(), rb_hash_aset(), rb_hash_new(), rb_rational_new2, rb_str_new(), rb_str_new2, RSTRING_LEN, RSTRING_PTR, s, sizeof_array, STD, str, str2num, strchr(), strcpy(), strlen(), T_STRING, and TYPE.
Definition at line 59 of file date_strptime.c.
References strchr().
Definition at line 78 of file date_strptime.c.
References ALLOCA_N, CHAR_BIT, LONG2NUM, memcpy(), rb_cstr_to_inum(), s, and v.
Definition at line 138 of file date_strptime.c.
References b, f_gt_p, f_lt_p, FIX2INT, FIXNUM_P, INT2NUM, and vi.
Referenced by date__strptime_internal().
|
static |
Definition at line 10 of file date_strptime.c.
Referenced by date__strptime_internal().
|
static |
Definition at line 30 of file date_strptime.c.
Referenced by date__strptime_internal().
|
static |
Definition at line 25 of file date_strptime.c.
Referenced by date__strptime_internal().
|
static |
Definition at line 17 of file date_strptime.c.
Referenced by date__strptime_internal().