date_core.c File Reference
`#include "ruby.h"`
`#include "ruby/encoding.h"`
`#include <math.h>`
`#include <time.h>`
`#include <assert.h>`
`#include "date_tmx.h"`
`#include <errno.h>`

Go to the source code of this file.

## Data Structures

struct | SimpleDateData
struct | ComplexDateData
union | DateData

## Macros

#define | NDEBUG
#define | USE_PACK
#define | f_boolcast(x) ((x) ? Qtrue : Qfalse)
#define | f_abs(x) rb_funcall(x, rb_intern("abs"), 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_quo(x, y) rb_funcall(x, rb_intern("quo"), 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_remainder(x, y) rb_funcall(x, rb_intern("remainder"), 1, y)
#define | f_expt(x, y) rb_funcall(x, rb_intern("**"), 1, y)
#define | f_floor(x) rb_funcall(x, rb_intern("floor"), 0)
#define | f_ceil(x) rb_funcall(x, rb_intern("ceil"), 0)
#define | f_truncate(x) rb_funcall(x, rb_intern("truncate"), 0)
#define | f_round(x) rb_funcall(x, rb_intern("round"), 0)
#define | f_to_i(x) rb_funcall(x, rb_intern("to_i"), 0)
#define | f_to_r(x) rb_funcall(x, rb_intern("to_r"), 0)
#define | f_to_s(x) rb_funcall(x, rb_intern("to_s"), 0)
#define | f_inspect(x) rb_funcall(x, rb_intern("inspect"), 0)
#define | f_add3(x, y, z) f_add(f_add(x, y), z)
#define | f_sub3(x, y, z) f_sub(f_sub(x, y), z)
#define | f_nonzero_p(x) (!f_zero_p(x))
#define | f_positive_p(x) (!f_negative_p(x))
#define | f_ajd(x) rb_funcall(x, rb_intern("ajd"), 0)
#define | f_jd(x) rb_funcall(x, rb_intern("jd"), 0)
#define | f_year(x) rb_funcall(x, rb_intern("year"), 0)
#define | f_mon(x) rb_funcall(x, rb_intern("mon"), 0)
#define | f_mday(x) rb_funcall(x, rb_intern("mday"), 0)
#define | f_wday(x) rb_funcall(x, rb_intern("wday"), 0)
#define | f_hour(x) rb_funcall(x, rb_intern("hour"), 0)
#define | f_min(x) rb_funcall(x, rb_intern("min"), 0)
#define | f_sec(x) rb_funcall(x, rb_intern("sec"), 0)
#define | NDIV(x, y) (-(-((x)+1)/(y))-1)
#define | NMOD(x, y) ((y)-(-((x)+1)%(y))-1)
#define | DIV(n, d) ((n)<0 ? NDIV((n),(d)) : (n)/(d))
#define | MOD(n, d) ((n)<0 ? NMOD((n),(d)) : (n)%(d))
#define | HAVE_JD (1 << 0)
#define | HAVE_DF (1 << 1)
#define | HAVE_CIVIL (1 << 2)
#define | HAVE_TIME (1 << 3)
#define | COMPLEX_DAT (1 << 7)
#define | have_jd_p(x) ((x)->flags & HAVE_JD)
#define | have_df_p(x) ((x)->flags & HAVE_DF)
#define | have_civil_p(x) ((x)->flags & HAVE_CIVIL)
#define | have_time_p(x) ((x)->flags & HAVE_TIME)
#define | complex_dat_p(x) ((x)->flags & COMPLEX_DAT)
#define | simple_dat_p(x) (!complex_dat_p(x))
#define | ITALY 2299161 /* 1582-10-15 */
#define | ENGLAND 2361222 /* 1752-09-14 */
#define | JULIAN positive_inf
#define | GREGORIAN negative_inf
#define | DEFAULT_SG ITALY
#define | UNIX_EPOCH_IN_CJD INT2FIX(2440588) /* 1970-01-01 */
#define | MINUTE_IN_SECONDS 60
#define | HOUR_IN_SECONDS 3600
#define | DAY_IN_SECONDS 86400
#define | SECOND_IN_MILLISECONDS 1000
#define | SECOND_IN_NANOSECONDS 1000000000
#define | JC_PERIOD0 1461 /* 365.25 * 4 */
#define | GC_PERIOD0 146097 /* 365.2425 * 400 */
#define | CM_PERIOD0 71149239 /* (lcm 7 1461 146097) */
#define | CM_PERIOD (0xfffffff / CM_PERIOD0 * CM_PERIOD0)
#define | CM_PERIOD_JCY (CM_PERIOD / JC_PERIOD0 * 4)
#define | CM_PERIOD_GCY (CM_PERIOD / GC_PERIOD0 * 400)
#define | REFORM_BEGIN_YEAR 1582
#define | REFORM_END_YEAR 1930
#define | REFORM_BEGIN_JD 2298874 /* ns 1582-01-01 */
#define | REFORM_END_JD 2426355 /* os 1930-12-31 */
#define | SEC_WIDTH 6
#define | MIN_WIDTH 6
#define | HOUR_WIDTH 5
#define | MDAY_WIDTH 5
#define | MON_WIDTH 4
#define | SEC_SHIFT 0
#define | MIN_SHIFT SEC_WIDTH
#define | HOUR_SHIFT (MIN_WIDTH + SEC_WIDTH)
#define | MDAY_SHIFT (HOUR_WIDTH + MIN_WIDTH + SEC_WIDTH)
#define | MON_SHIFT (MDAY_WIDTH + HOUR_WIDTH + MIN_WIDTH + SEC_WIDTH)
#define | PK_MASK(x) ((1 << (x)) - 1)
#define | EX_SEC(x) (((x) >> SEC_SHIFT) & PK_MASK(SEC_WIDTH))
#define | EX_MIN(x) (((x) >> MIN_SHIFT) & PK_MASK(MIN_WIDTH))
#define | EX_HOUR(x) (((x) >> HOUR_SHIFT) & PK_MASK(HOUR_WIDTH))
#define | EX_MDAY(x) (((x) >> MDAY_SHIFT) & PK_MASK(MDAY_WIDTH))
#define | EX_MON(x) (((x) >> MON_SHIFT) & PK_MASK(MON_WIDTH))
#define | PACK5(m, d, h, min, s)
#define | PACK2(m, d) (((m) << MON_SHIFT) | ((d) << MDAY_SHIFT))
#define | get_d1(x)
#define | get_d1a(x)
#define | get_d1b(x)
#define | get_d2(x, y)
#define | set_to_simple(x, _nth, _jd,_sg, _year, _mon, _mday, _flags)
#define | set_to_complex(x, _nth, _jd,_df, _sf, _of, _sg, _year, _mon, _mday, _hour, _min, _sec, _flags)
#define | copy_simple_to_complex(x, y)
#define | copy_complex_to_simple(x, y)
#define | HALF_DAYS_IN_SECONDS (DAY_IN_SECONDS / 2)
#define | decode_offset(of, s, h, m)
#define | valid_sg(sg)
#define | jd_trunc d_trunc
#define | k_trunc d_trunc
#define | num2num_with_frac(s, n)
#define | num2int_with_frac(s, n)
#define | canon24oc()
#define | add_frac()
#define | val2sg(vsg, dsg)
#define | set_hash0(k, v) rb_hash_aset(hash, k, v)
#define | ref_hash0(k) rb_hash_aref(hash, k)
#define | del_hash0(k) rb_hash_delete(hash, k)
#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 | sym(x) ID2SYM(rb_intern(x))
#define | val2off(vof, iof)
#define | SMALLBUF 100
#define | MILLISECOND_IN_NANOSECONDS 1000000
#define | f_getlocal(x) rb_funcall(x, rb_intern("getlocal"), 0)
#define | f_subsec(x) rb_funcall(x, rb_intern("subsec"), 0)
#define | f_utc_offset(x) rb_funcall(x, rb_intern("utc_offset"), 0)
#define | f_local3(x, y, m, d) rb_funcall(x, rb_intern("local"), 3, y, m, d)
#define | f_utc6(x, y, m, d, h, min, s)
#define | rb_intern(str) rb_intern_const(str)
#define | f_public(m, s)

## Functions

static VALUE | f_cmp (VALUE x, VALUE y)
static VALUE | f_lt_p (VALUE x, VALUE y)
static VALUE | f_gt_p (VALUE x, VALUE y)
static VALUE | f_le_p (VALUE x, VALUE y)
static VALUE | f_ge_p (VALUE x, VALUE y)
static VALUE | f_eqeq_p (VALUE x, VALUE y)
static VALUE | f_zero_p (VALUE x)
static VALUE | f_negative_p (VALUE x)
static VALUE | canon (VALUE x)
static int | c_valid_civil_p (int, int, int, double, int *, int *, int *, int *)
static int | c_find_fdoy (int y, double sg, int *rjd, int *ns)
static int | c_find_ldoy (int y, double sg, int *rjd, int *ns)
static int | c_find_ldom (int y, int m, double sg, int *rjd, int *ns)
static void | c_civil_to_jd (int y, int m, int d, double sg, int *rjd, int *ns)
static void | c_jd_to_civil (int jd, double sg, int *ry, int *rm, int *rdom)
static void | c_ordinal_to_jd (int y, int d, double sg, int *rjd, int *ns)
static void | c_jd_to_ordinal (int jd, double sg, int *ry, int *rd)
static void | c_commercial_to_jd (int y, int w, int d, double sg, int *rjd, int *ns)
static void | c_jd_to_commercial (int jd, double sg, int *ry, int *rw, int *rd)
static void | c_weeknum_to_jd (int y, int w, int d, int f, double sg, int *rjd, int *ns)
static void | c_jd_to_weeknum (int jd, int f, double sg, int *ry, int *rw, int *rd)
static int | c_jd_to_wday (int jd)
static int | c_valid_ordinal_p (int y, int d, double sg, int *rd, int *rjd, int *ns)
static int | c_julian_leap_p (int y)
static int | c_gregorian_leap_p (int y)
static int | c_julian_last_day_of_month (int y, int m)
static int | c_gregorian_last_day_of_month (int y, int m)
static int | c_valid_julian_p (int y, int m, int d, int *rm, int *rd)
static int | c_valid_gregorian_p (int y, int m, int d, int *rm, int *rd)
static int | c_valid_commercial_p (int y, int w, int d, double sg, int *rw, int *rd, int *rjd, int *ns)
static int | c_valid_weeknum_p (int y, int w, int d, int f, double sg, int *rw, int *rd, int *rjd, int *ns)
static int | c_valid_time_p (int h, int min, int s, int *rh, int *rmin, int *rs)
static int | c_valid_start_p (double sg)
static int | df_local_to_utc (int df, int of)
static int | df_utc_to_local (int df, int of)
static int | jd_local_to_utc (int jd, int df, int of)
static int | jd_utc_to_local (int jd, int df, int of)
static int | time_to_df (int h, int min, int s)
static void | df_to_time (int df, int *h, int *min, int *s)
static VALUE | sec_to_day (VALUE s)
static VALUE | isec_to_day (int s)
static VALUE | ns_to_day (VALUE n)
static VALUE | ns_to_sec (VALUE n)
static int | safe_mul_p (VALUE x, long m)
static VALUE | day_to_sec (VALUE d)
static VALUE | sec_to_ms (VALUE s)
static VALUE | sec_to_ns (VALUE s)
static VALUE | div_day (VALUE d, VALUE *f)
static VALUE | div_df (VALUE d, VALUE *f)
static void | decode_day (VALUE d, VALUE *jd, VALUE *df, VALUE *sf)
static double | s_virtual_sg (union DateData *x)
static double | c_virtual_sg (union DateData *x)
static double | m_virtual_sg (union DateData *x)
static void | get_s_jd (union DateData *x)
static void | get_s_civil (union DateData *x)
static void | get_c_df (union DateData *x)
static void | get_c_time (union DateData *x)
static void | get_c_jd (union DateData *x)
static void | get_c_civil (union DateData *x)
static int | local_jd (union DateData *x)
static int | local_df (union DateData *x)
static void | decode_year (VALUE y, double style, VALUE *nth, int *ry)
static void | encode_year (VALUE nth, int y, double style, VALUE *ry)
static void | decode_jd (VALUE jd, VALUE *nth, int *rjd)
static void | encode_jd (VALUE nth, int jd, VALUE *rjd)
static double | guess_style (VALUE y, double sg)
static VALUE | m_nth (union DateData *x)
static int | m_jd (union DateData *x)
static VALUE | m_real_jd (union DateData *x)
static int | m_local_jd (union DateData *x)
static VALUE | m_real_local_jd (union DateData *x)
static int | m_df (union DateData *x)
static int | m_local_df (union DateData *x)
static VALUE | m_sf (union DateData *x)
static VALUE | m_sf_in_sec (union DateData *x)
static VALUE | m_fr (union DateData *x)
static VALUE | m_ajd (union DateData *x)
static VALUE | m_amjd (union DateData *x)
static int | m_of (union DateData *x)
static VALUE | m_of_in_day (union DateData *x)
static double | m_sg (union DateData *x)
static int | m_julian_p (union DateData *x)
static int | m_gregorian_p (union DateData *x)
static int | m_proleptic_julian_p (union DateData *x)
static int | m_proleptic_gregorian_p (union DateData *x)
static int | m_year (union DateData *x)
static VALUE | m_real_year (union DateData *x)
static int | m_pc (union DateData *x)
static int | m_mon (union DateData *x)
static int | m_mday (union DateData *x)
static int | c_julian_to_yday (int y, int m, int d)
static int | c_gregorian_to_yday (int y, int m, int d)
static int | m_yday (union DateData *x)
static int | m_wday (union DateData *x)
static int | m_cwyear (union DateData *x)
static VALUE | m_real_cwyear (union DateData *x)
static int | m_cweek (union DateData *x)
static int | m_cwday (union DateData *x)
static int | m_wnumx (union DateData *x, int f)
static int | m_wnum0 (union DateData *x)
static int | m_wnum1 (union DateData *x)
static int | m_hour (union DateData *x)
static int | m_min (union DateData *x)
static int | m_sec (union DateData *x)
static VALUE | of2str (int of)
static VALUE | m_zone (union DateData *x)
static VALUE | f_kind_of_p (VALUE x, VALUE c)
static VALUE | k_date_p (VALUE x)
static VALUE | k_datetime_p (VALUE x)
static VALUE | k_numeric_p (VALUE x)
static VALUE | k_rational_p (VALUE x)
static int | valid_ordinal_p (VALUE y, int d, double sg, VALUE *nth, int *ry, int *rd, int *rjd, int *ns)
static int | valid_gregorian_p (VALUE y, int m, int d, VALUE *nth, int *ry, int *rm, int *rd)
static int | valid_civil_p (VALUE y, int m, int d, double sg, VALUE *nth, int *ry, int *rm, int *rd, int *rjd, int *ns)
static int | valid_commercial_p (VALUE y, int w, int d, double sg, VALUE *nth, int *ry, int *rw, int *rd, int *rjd, int *ns)
static int | valid_weeknum_p (VALUE y, int w, int d, int f, double sg, VALUE *nth, int *ry, int *rw, int *rd, int *rjd, int *ns)
VALUE | date_zone_to_diff (VALUE)
static int | offset_to_sec (VALUE vof, int *rof)
static VALUE | valid_jd_sub (int argc, VALUE *argv, VALUE klass, int need_jd)
static VALUE | date_s_valid_jd_p (int argc, VALUE *argv, VALUE klass)
static VALUE | valid_civil_sub (int argc, VALUE *argv, VALUE klass, int need_jd)
static VALUE | date_s_valid_civil_p (int argc, VALUE *argv, VALUE klass)
static VALUE | valid_ordinal_sub (int argc, VALUE *argv, VALUE klass, int need_jd)
static VALUE | date_s_valid_ordinal_p (int argc, VALUE *argv, VALUE klass)
static VALUE | valid_commercial_sub (int argc, VALUE *argv, VALUE klass, int need_jd)
static VALUE | date_s_valid_commercial_p (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s_julian_leap_p (VALUE klass, VALUE y)
static VALUE | date_s_gregorian_leap_p (VALUE klass, VALUE y)
static void | d_lite_gc_mark (union DateData *dat)
static VALUE | d_simple_new_internal (VALUE klass, VALUE nth, int jd, double sg, int y, int m, int d, unsigned flags)
static VALUE | d_complex_new_internal (VALUE klass, VALUE nth, int jd, int df, VALUE sf, int of, double sg, int y, int m, int d, int h, int min, int s, unsigned flags)
static VALUE | d_lite_s_alloc_simple (VALUE klass)
static VALUE | d_lite_s_alloc_complex (VALUE klass)
static VALUE | d_lite_s_alloc (VALUE klass)
static void | old_to_new (VALUE ajd, VALUE of, VALUE sg, VALUE *rnth, int *rjd, int *rdf, VALUE *rsf, int *rof, double *rsg)
static int | wholenum_p (VALUE x)
static VALUE | to_integer (VALUE x)
static VALUE | d_trunc (VALUE d, VALUE *fr)
static VALUE | h_trunc (VALUE h, VALUE *fr)
static VALUE | min_trunc (VALUE min, VALUE *fr)
static VALUE | s_trunc (VALUE s, VALUE *fr)
static VALUE | d_lite_plus (VALUE, VALUE)
static VALUE | date_s_jd (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s_ordinal (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s_civil (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s_commercial (int argc, VALUE *argv, VALUE klass)
static struct tm * | gmtime_r (const time_t *t, struct tm *tm)
static struct tm * | localtime_r (const time_t *t, struct tm *tm)
static void | set_sg (union DateData *, double)
static VALUE | date_s_today (int argc, VALUE *argv, VALUE klass)
static VALUE | rt_rewrite_frags (VALUE hash)
static VALUE | d_lite_year (VALUE)
static VALUE | d_lite_wday (VALUE)
static VALUE | d_lite_jd (VALUE)
static VALUE | rt_complete_frags (VALUE klass, VALUE hash)
static VALUE | rt__valid_jd_p (VALUE jd, VALUE sg)
static VALUE | rt__valid_ordinal_p (VALUE y, VALUE d, VALUE sg)
static VALUE | rt__valid_civil_p (VALUE y, VALUE m, VALUE d, VALUE sg)
static VALUE | rt__valid_commercial_p (VALUE y, VALUE w, VALUE d, VALUE sg)
static VALUE | rt__valid_weeknum_p (VALUE y, VALUE w, VALUE d, VALUE f, VALUE sg)
static VALUE | rt__valid_date_frags_p (VALUE hash, VALUE sg)
static VALUE | d_new_by_frags (VALUE klass, VALUE hash, VALUE sg)
VALUE | date__strptime (const char *str, size_t slen, const char *fmt, size_t flen, VALUE hash)
static VALUE | date_s__strptime_internal (int argc, VALUE *argv, VALUE klass, const char *default_fmt)
static VALUE | date_s__strptime (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s_strptime (int argc, VALUE *argv, VALUE klass)
VALUE | date__parse (VALUE str, VALUE comp)
static VALUE | date_s__parse_internal (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s__parse (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s_parse (int argc, VALUE *argv, VALUE klass)
VALUE | date__iso8601 (VALUE)
VALUE | date__rfc3339 (VALUE)
VALUE | date__xmlschema (VALUE)
VALUE | date__rfc2822 (VALUE)
VALUE | date__httpdate (VALUE)
VALUE | date__jisx0301 (VALUE)
static VALUE | date_s__iso8601 (VALUE klass, VALUE str)
static VALUE | date_s_iso8601 (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s__rfc3339 (VALUE klass, VALUE str)
static VALUE | date_s_rfc3339 (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s__xmlschema (VALUE klass, VALUE str)
static VALUE | date_s_xmlschema (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s__rfc2822 (VALUE klass, VALUE str)
static VALUE | date_s_rfc2822 (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s__httpdate (VALUE klass, VALUE str)
static VALUE | date_s_httpdate (int argc, VALUE *argv, VALUE klass)
static VALUE | date_s__jisx0301 (VALUE klass, VALUE str)
static VALUE | date_s_jisx0301 (int argc, VALUE *argv, VALUE klass)
static VALUE | dup_obj (VALUE self)
static VALUE | dup_obj_as_complex (VALUE self)
static VALUE | d_lite_initialize_copy (VALUE copy, VALUE date)
static VALUE | d_lite_ajd (VALUE self)
static VALUE | d_lite_amjd (VALUE self)
static VALUE | d_lite_mjd (VALUE self)
static VALUE | d_lite_ld (VALUE self)
static VALUE | d_lite_yday (VALUE self)
static VALUE | d_lite_mon (VALUE self)
static VALUE | d_lite_mday (VALUE self)
static VALUE | d_lite_day_fraction (VALUE self)
static VALUE | d_lite_cwyear (VALUE self)
static VALUE | d_lite_cweek (VALUE self)
static VALUE | d_lite_cwday (VALUE self)
static VALUE | d_lite_sunday_p (VALUE self)
static VALUE | d_lite_monday_p (VALUE self)
static VALUE | d_lite_tuesday_p (VALUE self)
static VALUE | d_lite_wednesday_p (VALUE self)
static VALUE | d_lite_thursday_p (VALUE self)
static VALUE | d_lite_friday_p (VALUE self)
static VALUE | d_lite_saturday_p (VALUE self)
static VALUE | d_lite_hour (VALUE self)
static VALUE | d_lite_min (VALUE self)
static VALUE | d_lite_sec (VALUE self)
static VALUE | d_lite_sec_fraction (VALUE self)
static VALUE | d_lite_offset (VALUE self)
static VALUE | d_lite_zone (VALUE self)
static VALUE | d_lite_julian_p (VALUE self)
static VALUE | d_lite_gregorian_p (VALUE self)
static VALUE | d_lite_leap_p (VALUE self)
static VALUE | d_lite_start (VALUE self)
static void | clear_civil (union DateData *x)
static VALUE | dup_obj_with_new_start (VALUE obj, double sg)
static VALUE | d_lite_new_start (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_italy (VALUE self)
static VALUE | d_lite_england (VALUE self)
static VALUE | d_lite_julian (VALUE self)
static VALUE | d_lite_gregorian (VALUE self)
static void | set_of (union DateData *x, int of)
static VALUE | dup_obj_with_new_offset (VALUE obj, int of)
static VALUE | d_lite_new_offset (int argc, VALUE *argv, VALUE self)
static VALUE | minus_dd (VALUE self, VALUE other)
static VALUE | d_lite_minus (VALUE self, VALUE other)
static VALUE | d_lite_next_day (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_prev_day (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_next (VALUE self)
static VALUE | d_lite_rshift (VALUE self, VALUE other)
static VALUE | d_lite_lshift (VALUE self, VALUE other)
static VALUE | d_lite_next_month (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_prev_month (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_next_year (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_prev_year (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_cmp (VALUE, VALUE)
static VALUE | d_lite_step (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_upto (VALUE self, VALUE max)
static VALUE | d_lite_downto (VALUE self, VALUE min)
static VALUE | cmp_gen (VALUE self, VALUE other)
static VALUE | cmp_dd (VALUE self, VALUE other)
static VALUE | equal_gen (VALUE self, VALUE other)
static VALUE | d_lite_equal (VALUE self, VALUE other)
static VALUE | d_lite_eql_p (VALUE self, VALUE other)
static VALUE | d_lite_hash (VALUE self)
static void | set_tmx (VALUE, struct tmx *)
static VALUE | strftimev (const char *, VALUE, void(*)(VALUE, struct tmx *))
static VALUE | d_lite_to_s (VALUE self)
static VALUE | mk_inspect (union DateData *x, const char *klass, const char *to_s)
static VALUE | d_lite_inspect (VALUE self)
size_t | date_strftime (char *s, size_t maxsize, const char *format, const struct tmx *tmx)
static size_t | date_strftime_alloc (char **buf, const char *format, struct tmx *tmx)
static VALUE | tmx_m_secs (union DateData *x)
static VALUE | tmx_m_msecs (union DateData *x)
static VALUE | tmx_m_of (union DateData *x)
static char * | tmx_m_zone (union DateData *x)
static VALUE | date_strftime_internal (int argc, VALUE *argv, VALUE self, const char *default_fmt, void(*func)(VALUE, struct tmx *))
static VALUE | d_lite_strftime (int argc, VALUE *argv, VALUE self)
static VALUE | d_lite_asctime (VALUE self)
static VALUE | d_lite_iso8601 (VALUE self)
static VALUE | d_lite_rfc3339 (VALUE self)
static VALUE | d_lite_rfc2822 (VALUE self)
static VALUE | d_lite_httpdate (VALUE self)
static VALUE | jisx0301_date (VALUE jd, VALUE y)
static VALUE | d_lite_jisx0301 (VALUE self)
static VALUE | d_lite_marshal_dump (VALUE self)
static VALUE | d_lite_marshal_load (VALUE self, VALUE a)
static VALUE | datetime_s_jd (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_ordinal (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_civil (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_commercial (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_now (int argc, VALUE *argv, VALUE klass)
static VALUE | dt_new_by_frags (VALUE klass, VALUE hash, VALUE sg)
static VALUE | datetime_s__strptime (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_strptime (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_parse (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_iso8601 (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_rfc3339 (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_xmlschema (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_rfc2822 (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_httpdate (int argc, VALUE *argv, VALUE klass)
static VALUE | datetime_s_jisx0301 (int argc, VALUE *argv, VALUE klass)
static VALUE | dt_lite_to_s (VALUE self)
static VALUE | dt_lite_strftime (int argc, VALUE *argv, VALUE self)
static VALUE | iso8601_timediv (VALUE self, VALUE n)
static VALUE | dt_lite_iso8601 (int argc, VALUE *argv, VALUE self)
static VALUE | dt_lite_rfc3339 (int argc, VALUE *argv, VALUE self)
static VALUE | dt_lite_jisx0301 (int argc, VALUE *argv, VALUE self)
static VALUE | time_to_time (VALUE self)
static VALUE | time_to_date (VALUE self)
static VALUE | time_to_datetime (VALUE self)
static VALUE | date_to_time (VALUE self)
static VALUE | date_to_date (VALUE self)
static VALUE | date_to_datetime (VALUE self)
static VALUE | datetime_to_time (VALUE self)
static VALUE | datetime_to_date (VALUE self)
static VALUE | datetime_to_datetime (VALUE self)
static VALUE | mk_ary_of_str (long len, const char *a[])
void | Init_date_core (void)

## Variables

static ID | id_cmp
static ID | id_le_p
static ID | id_ge_p
static ID | id_eqeq_p
static VALUE | cDate
static VALUE | cDateTime
static VALUE | half_days_in_day
static VALUE | day_in_nanoseconds
static double | positive_inf
static double | negative_inf
static const int | monthtab [2][13]
static const int | yeartab [2][13]
static struct tmx_funcs | tmx_funcs
static const char * | monthnames []
static const char * | abbr_monthnames []
static const char * | daynames []
static const char * | abbr_daynames []

## Macro Definition Documentation

#define add_frac | ( |  | ) |

Value:
{\
if (f_nonzero_p(fr2))\
ret = d_lite_plus(ret, fr2);\
}

Definition at line 3206 of file date_core.c.

Referenced by date_s_civil(), date_s_commercial(), date_s_jd(), date_s_ordinal(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), and datetime_s_ordinal().

#define canon24oc | ( |  | ) |

Value:
{\
if (rh == 24) {\
rh = 0;\
fr2 = f_add(fr2, INT2FIX(1));\
}\
}

Definition at line 3198 of file date_core.c.

Referenced by datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), and datetime_s_ordinal().

#define CM_PERIOD (0xfffffff / CM_PERIOD0 * CM_PERIOD0)

Definition at line 179 of file date_core.c.

Referenced by d_lite_plus(), decode_jd(), encode_jd(), and minus_dd().

#define CM_PERIOD0 71149239 /* (lcm 7 1461 146097) */

Definition at line 178 of file date_core.c.

#define CM_PERIOD_GCY (CM_PERIOD / GC_PERIOD0 * 400)

Definition at line 181 of file date_core.c.

Referenced by decode_year(), and encode_year().

#define CM_PERIOD_JCY (CM_PERIOD / JC_PERIOD0 * 4)

Definition at line 180 of file date_core.c.

Referenced by decode_year(), and encode_year().

#define COMPLEX_DAT (1 << 7)

Definition at line 153 of file date_core.c.

Referenced by d_complex_new_internal(), d_lite_initialize_copy(), d_lite_marshal_load(), d_lite_plus(), d_simple_new_internal(), datetime_to_date(), and dup_obj_as_complex().

#define complex_dat_p | ( |  | x | ) | ((x)->flags & COMPLEX_DAT)

Definition at line 159 of file date_core.c.

Referenced by d_lite_initialize_copy(), d_lite_marshal_load(), get_c_civil(), get_c_df(), get_c_jd(), get_c_time(), local_df(), local_jd(), and set_of().

#define copy_complex_to_simple | ( |  | x,
|  |  | y
| ) |  |

Value:
{\
(x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->sg = (sg_cast)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK2(EX_MON((y)->pc), EX_MDAY((y)->pc));\
(x)->flags = (y)->flags;\
}

Definition at line 424 of file date_core.c.

Referenced by datetime_to_date().

#define copy_simple_to_complex | ( |  | x,
|  |  | y
| ) |  |

Value:
{\
(x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->df = 0;\
(x)->sf = INT2FIX(0);\
(x)->of = 0;\
(x)->sg = (sg_cast)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK5(EX_MON((y)->pc), EX_MDAY((y)->pc), 0, 0, 0);\
(x)->flags = (y)->flags;\
}

Definition at line 398 of file date_core.c.

Referenced by dup_obj_as_complex().

#define DAY_IN_SECONDS 86400

Definition at line 172 of file date_core.c.

Referenced by d_lite_plus(), datetime_s_now(), day_to_sec(), df_local_to_utc(), df_utc_to_local(), dt_new_by_frags(), Init_date_core(), jd_local_to_utc(), jd_utc_to_local(), minus_dd(), offset_to_sec(), old_to_new(), rt_rewrite_frags(), and sec_to_day().

#define decode_offset | ( |  | of,
|  |  | s,
|  |  | h,
|  |  | m
| ) |  |

Value:
{\
int a;\
s = (of < 0) ? '-' : '+';\
a = (of < 0) ? -of : of;\
h = a / HOUR_IN_SECONDS;\
m = a % HOUR_IN_SECONDS / MINUTE_IN_SECONDS;\
}

Definition at line 1901 of file date_core.c.

Referenced by of2str().

#define DEFAULT_SG ITALY

Definition at line 166 of file date_core.c.

Referenced by d_lite_new_start(), d_lite_s_alloc_complex(), d_lite_s_alloc_simple(), d_new_by_frags(), date_s_civil(), date_s_commercial(), date_s_httpdate(), date_s_iso8601(), date_s_jd(), date_s_jisx0301(), date_s_ordinal(), date_s_parse(), date_s_rfc2822(), date_s_rfc3339(), date_s_strptime(), date_s_today(), date_s_valid_civil_p(), date_s_valid_commercial_p(), date_s_valid_jd_p(), date_s_valid_ordinal_p(), date_s_xmlschema(), datetime_s_civil(), datetime_s_commercial(), datetime_s_httpdate(), datetime_s_iso8601(), datetime_s_jd(), datetime_s_jisx0301(), datetime_s_now(), datetime_s_ordinal(), datetime_s_parse(), datetime_s_rfc2822(), datetime_s_rfc3339(), datetime_s_strptime(), datetime_s_xmlschema(), dt_new_by_frags(), old_to_new(), time_to_date(), and time_to_datetime().

#define del_hash | ( |  | k | ) | rb_hash_delete(hash, ID2SYM(rb_intern(k)))

Definition at line 3663 of file date_core.c.

Referenced by rt_rewrite_frags().

#define del_hash0 | ( |  | k | ) | rb_hash_delete(hash, k)

Definition at line 3659 of file date_core.c.

#define DIV | ( |  | n,
|  |  | d
| ) |  | ((n)<0 ? NDIV((n),(d)) : (n)/(d))

Definition at line 146 of file date_core.c.

Referenced by c_jd_to_commercial(), c_jd_to_weeknum(), d_lite_plus(), d_lite_rshift(), decode_year(), and vm_init_redefined_flag().

#define ENGLAND 2361222 /* 1752-09-14 */

Definition at line 163 of file date_core.c.

Referenced by d_lite_england(), and Init_date_core().

#define EX_HOUR | ( |  | x | ) | (((x) >> HOUR_SHIFT) & PK_MASK(HOUR_WIDTH))

Definition at line 205 of file date_core.c.

Referenced by d_lite_plus(), get_c_civil(), get_c_df(), get_c_jd(), and m_hour().

#define EX_MDAY | ( |  | x | ) | (((x) >> MDAY_SHIFT) & PK_MASK(MDAY_WIDTH))

Definition at line 206 of file date_core.c.

Referenced by date_to_datetime(), get_c_jd(), get_c_time(), get_s_jd(), and m_mday().

#define EX_MIN | ( |  | x | ) | (((x) >> MIN_SHIFT) & PK_MASK(MIN_WIDTH))

Definition at line 204 of file date_core.c.

Referenced by d_lite_plus(), get_c_civil(), get_c_df(), get_c_jd(), and m_min().

#define EX_MON | ( |  | x | ) | (((x) >> MON_SHIFT) & PK_MASK(MON_WIDTH))

Definition at line 207 of file date_core.c.

Referenced by date_to_datetime(), get_c_jd(), get_c_time(), get_s_jd(), and m_mon().

#define EX_SEC | ( |  | x | ) | (((x) >> SEC_SHIFT) & PK_MASK(SEC_WIDTH))

Definition at line 203 of file date_core.c.

Referenced by d_lite_plus(), get_c_civil(), get_c_df(), get_c_jd(), and m_sec().

#define f_abs | ( |  | x | ) | rb_funcall(x, rb_intern("abs"), 0)

Definition at line 26 of file date_core.c.

Referenced by f_divide(), f_format(), f_lcm(), float_rationalize(), nucomp_abs(), nucomp_expt(), nucomp_polar(), numeric_polar(), and nurat_rationalize().

#define f_add | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, '+', 1, y)

Definition at line 28 of file date_core.c.

Referenced by d_lite_plus(), datetime_to_time(), decode_year(), dt_lite_iso8601(), encode_jd(), encode_year(), m_ajd(), m_amjd(), m_fr(), minus_dd(), old_to_new(), rt_complete_frags(), rt_rewrite_frags(), tmx_m_msecs(), and tmx_m_secs().

#define f_add3 | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | f_add(f_add(x, y), z)

Definition at line 47 of file date_core.c.

Referenced by d_lite_rshift().

#define f_ajd | ( |  | x | ) | rb_funcall(x, rb_intern("ajd"), 0)

Definition at line 133 of file date_core.c.

Referenced by cmp_gen().

#define f_boolcast | ( |  | x | ) | ((x) ? Qtrue : Qfalse)

Definition at line 24 of file date_core.c.

Referenced by d_lite_friday_p(), d_lite_gregorian_p(), d_lite_julian_p(), d_lite_leap_p(), d_lite_monday_p(), d_lite_saturday_p(), d_lite_sunday_p(), d_lite_thursday_p(), d_lite_tuesday_p(), d_lite_wednesday_p(), date_s_gregorian_leap_p(), date_s_julian_leap_p(), f_eqeq_p(), f_ge_p(), f_gt_p(), f_le_p(), f_lt_p(), f_negative_p(), and f_zero_p().

#define f_ceil | ( |  | x | ) | rb_funcall(x, rb_intern("ceil"), 0)

Definition at line 38 of file date_core.c.

#define f_div | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, '/', 1, y)

Definition at line 31 of file date_core.c.

Referenced by tmx_m_msecs().

#define f_expt | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, rb_intern("**"), 1, y)

Definition at line 36 of file date_core.c.

Referenced by float_rationalize(), float_to_r(), iso8601_timediv(), nucomp_expt(), and nurat_expt().

#define f_floor | ( |  | x | ) | rb_funcall(x, rb_intern("floor"), 0)

Definition at line 37 of file date_core.c.

Referenced by d_lite_plus(), div_day(), and div_df().

#define f_getlocal | ( |  | x | ) | rb_funcall(x, rb_intern("getlocal"), 0)

Definition at line 8624 of file date_core.c.

Referenced by datetime_to_time().

#define f_hour | ( |  | x | ) | rb_funcall(x, rb_intern("hour"), 0)

Definition at line 139 of file date_core.c.

Referenced by time_to_datetime().

#define f_idiv | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, rb_intern("div"), 1, y)

Definition at line 33 of file date_core.c.

Referenced by d_lite_plus(), d_lite_rshift(), d_trunc(), decode_jd(), decode_year(), f_addsub(), f_muldiv(), h_trunc(), min_trunc(), nurat_ceil(), nurat_floor(), nurat_round(), nurat_s_canonicalize_internal(), nurat_truncate(), rt_rewrite_frags(), and s_trunc().

#define f_inspect | ( |  | x | ) | rb_funcall(x, rb_intern("inspect"), 0)

Definition at line 45 of file date_core.c.

Referenced by mk_inspect(), nucomp_inspect(), nurat_inspect(), string_to_c_strict(), and string_to_r_strict().

#define f_jd | ( |  | x | ) | rb_funcall(x, rb_intern("jd"), 0)

Definition at line 134 of file date_core.c.

Referenced by equal_gen().

#define f_local3 | ( |  | x,
|  |  | y,
|  |  | m,
|  |  | d
| ) |  | rb_funcall(x, rb_intern("local"), 3, y, m, d)

Definition at line 8627 of file date_core.c.

Referenced by date_to_time().

#define f_mday | ( |  | x | ) | rb_funcall(x, rb_intern("mday"), 0)

Definition at line 137 of file date_core.c.

Referenced by time_to_date(), and time_to_datetime().

#define f_min | ( |  | x | ) | rb_funcall(x, rb_intern("min"), 0)

Definition at line 140 of file date_core.c.

Referenced by time_to_datetime().

#define f_mod | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, '%', 1, y)

Definition at line 34 of file date_core.c.

Referenced by d_lite_plus(), d_lite_rshift(), d_trunc(), decode_jd(), decode_year(), div_day(), div_df(), f_gcd(), h_trunc(), min_trunc(), rt__valid_date_frags_p(), rt_rewrite_frags(), and s_trunc().

#define f_mon | ( |  | x | ) | rb_funcall(x, rb_intern("mon"), 0)

Definition at line 136 of file date_core.c.

Referenced by time_to_date(), and time_to_datetime().

#define f_mul | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, '*', 1, y)

Definition at line 30 of file date_core.c.

Referenced by d_lite_next_year(), d_lite_plus(), d_lite_prev_year(), d_lite_rshift(), day_to_sec(), encode_jd(), encode_year(), f_addsub(), f_complex_polar(), f_divide(), f_lcm(), f_muldiv(), f_round_common(), float_rationalize(), float_to_r(), imp1(), Init_date_core(), m_ajd(), m_sin(), minus_dd(), nucomp_abs2(), nucomp_expt(), nucomp_mul(), nucomp_numerator(), nucomp_s_convert(), numeric_abs2(), nurat_cmp(), nurat_div(), nurat_mul(), nurat_rationalize_internal(), nurat_round(), sec_to_ms(), sec_to_ns(), and string_to_r_internal().

#define f_negate | ( |  | x | ) | rb_funcall(x, rb_intern("-@"), 0)

Definition at line 27 of file date_core.c.

Referenced by d_lite_lshift(), d_lite_minus(), d_lite_plus(), f_divide(), f_gcd(), f_muldiv(), float_rationalize(), imp1(), nucomp_conj(), nucomp_expt(), nucomp_negate(), nurat_ceil(), nurat_expt(), nurat_rationalize(), nurat_round(), nurat_s_canonicalize_internal(), nurat_s_canonicalize_internal_no_reduce(), nurat_truncate(), and string_to_r_internal().

#define f_nonzero_p | ( |  | x | ) | (!f_zero_p(x))

Definition at line 121 of file date_core.c.

Referenced by decode_year(), m_ajd(), m_amjd(), m_fr(), minus_dd(), and tmx_m_msecs().

#define f_positive_p | ( |  | x | ) | (!f_negative_p(x))

Definition at line 131 of file date_core.c.

Referenced by d_lite_plus(), and guess_style().

#define f_public | ( |  | m,
|  |  | s
| ) |  |

Value:
rb_funcall(m, rb_intern("public"), 1,\
ID2SYM(rb_intern(s)))

Referenced by Init_date_core().

#define f_quo | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, rb_intern("quo"), 1, y)

Definition at line 32 of file date_core.c.

Referenced by f_reciprocal(), h_trunc(), iso8601_timediv(), min_trunc(), ns_to_day(), ns_to_sec(), nucomp_div(), s_trunc(), and sec_to_day().

#define f_remainder | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, rb_intern("remainder"), 1, y)

Definition at line 35 of file date_core.c.

#define f_round | ( |  | x | ) | rb_funcall(x, rb_intern("round"), 0)

Definition at line 40 of file date_core.c.

Referenced by iso8601_timediv(), offset_to_sec(), and old_to_new().

#define f_sec | ( |  | x | ) | rb_funcall(x, rb_intern("sec"), 0)

Definition at line 141 of file date_core.c.

Referenced by time_to_datetime().

#define f_sub | ( |  | x,
|  |  | y
| ) |  | rb_funcall(x, '-', 1, y)

Definition at line 29 of file date_core.c.

Referenced by d_lite_ld(), d_lite_mjd(), d_lite_plus(), d_lite_rshift(), jisx0301_date(), m_ajd(), m_amjd(), minus_dd(), rt__valid_date_frags_p(), rt_complete_frags(), and tmx_m_secs().

#define f_sub3 | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | f_sub(f_sub(x, y), z)

Definition at line 48 of file date_core.c.

#define f_subsec | ( |  | x | ) | rb_funcall(x, rb_intern("subsec"), 0)

Definition at line 8625 of file date_core.c.

Referenced by time_to_datetime().

#define f_to_i | ( |  | x | ) | rb_funcall(x, rb_intern("to_i"), 0)

Definition at line 42 of file date_core.c.

Referenced by f_round_common(), nucomp_to_i(), nurat_int_value(), string_to_c_internal(), string_to_r_internal(), and to_integer().

#define f_to_r | ( |  | x | ) | rb_funcall(x, rb_intern("to_r"), 0)

Definition at line 43 of file date_core.c.

Referenced by d_lite_plus(), float_rationalize(), float_to_r(), nucomp_to_r(), numeric_denominator(), numeric_numerator(), nurat_s_convert(), offset_to_sec(), and string_to_c_internal().

#define f_to_s | ( |  | x | ) | rb_funcall(x, rb_intern("to_s"), 0)

Definition at line 44 of file date_core.c.

Referenced by d_lite_inspect(), nucomp_rationalize(), nucomp_to_f(), nucomp_to_i(), nucomp_to_r(), nucomp_to_s(), and nurat_to_s().

#define f_truncate | ( |  | x | ) | rb_funcall(x, rb_intern("truncate"), 0)

Definition at line 39 of file date_core.c.

#define f_utc6 | ( |  | x,
|  |  | y,
|  |  | m,
|  |  | d,
|  |  | h,
|  |  | min,
|  |  | s
| ) |  |

Value:
rb_funcall(x, rb_intern("utc"), 6,\
y, m, d, h, min, s)

Definition at line 8628 of file date_core.c.

Referenced by datetime_to_time().

#define f_utc_offset | ( |  | x | ) | rb_funcall(x, rb_intern("utc_offset"), 0)

Definition at line 8626 of file date_core.c.

Referenced by time_to_datetime().

#define f_wday | ( |  | x | ) | rb_funcall(x, rb_intern("wday"), 0)

Definition at line 138 of file date_core.c.

#define f_year | ( |  | x | ) | rb_funcall(x, rb_intern("year"), 0)

Definition at line 135 of file date_core.c.

Referenced by time_to_date(), and time_to_datetime().

#define GC_PERIOD0 146097 /* 365.2425 * 400 */

Definition at line 177 of file date_core.c.

#define get_d1 | ( |  | x | ) |

Value:
union DateData *dat;\
Data_Get_Struct(x, union DateData, dat);

Definition at line 295 of file date_core.c.

Referenced by cmp_gen(), d_lite_ajd(), d_lite_amjd(), d_lite_cwday(), d_lite_cweek(), d_lite_cwyear(), d_lite_day_fraction(), d_lite_friday_p(), d_lite_gregorian_p(), d_lite_hash(), d_lite_hour(), d_lite_inspect(), d_lite_jd(), d_lite_jisx0301(), d_lite_julian_p(), d_lite_ld(), d_lite_leap_p(), d_lite_marshal_dump(), d_lite_marshal_load(), d_lite_mday(), d_lite_min(), d_lite_mjd(), d_lite_mon(), d_lite_monday_p(), d_lite_offset(), d_lite_plus(), d_lite_rshift(), d_lite_saturday_p(), d_lite_sec(), d_lite_sec_fraction(), d_lite_start(), d_lite_sunday_p(), d_lite_thursday_p(), d_lite_tuesday_p(), d_lite_wday(), d_lite_wednesday_p(), d_lite_yday(), d_lite_year(), d_lite_zone(), date_s_today(), date_to_time(), datetime_s_now(), datetime_to_time(), dt_lite_jisx0301(), dup_obj_with_new_offset(), dup_obj_with_new_start(), equal_gen(), iso8601_timediv(), set_tmx(), time_to_date(), and time_to_datetime().

#define get_d1a | ( |  | x | ) |

Value:
union DateData *adat;\
Data_Get_Struct(x, union DateData, adat);

Definition at line 299 of file date_core.c.

Referenced by date_to_datetime(), datetime_to_date(), dup_obj(), and dup_obj_as_complex().

#define get_d1b | ( |  | x | ) |

Value:
union DateData *bdat;\
Data_Get_Struct(x, union DateData, bdat);

Definition at line 303 of file date_core.c.

Referenced by date_to_datetime(), datetime_to_date(), dup_obj(), and dup_obj_as_complex().

#define get_d2 | ( |  | x,
|  |  | y
| ) |  |

Value:
union DateData *adat, *bdat;\
Data_Get_Struct(x, union DateData, adat);\
Data_Get_Struct(y, union DateData, bdat);

Definition at line 307 of file date_core.c.

Referenced by cmp_dd(), d_lite_cmp(), d_lite_equal(), d_lite_initialize_copy(), and minus_dd().

#define GREGORIAN negative_inf

Definition at line 165 of file date_core.c.

Referenced by d_lite_gregorian(), date_s_today(), datetime_s_now(), Init_date_core(), and time_to_date().

#define HALF_DAYS_IN_SECONDS (DAY_IN_SECONDS / 2)

Definition at line 1512 of file date_core.c.

Referenced by m_ajd().

#define HAVE_CIVIL (1 << 2)

Definition at line 151 of file date_core.c.

Referenced by clear_civil(), d_lite_plus(), date_s_civil(), date_s_today(), datetime_s_civil(), datetime_s_now(), get_c_civil(), get_s_civil(), time_to_date(), and time_to_datetime().

#define have_civil_p | ( |  | x | ) | ((x)->flags & HAVE_CIVIL)

Definition at line 157 of file date_core.c.

Referenced by d_complex_new_internal(), d_simple_new_internal(), get_c_civil(), get_c_jd(), get_s_civil(), and get_s_jd().

#define HAVE_DF (1 << 1)

Definition at line 150 of file date_core.c.

Referenced by d_lite_marshal_load(), d_lite_plus(), d_lite_s_alloc_complex(), date_to_datetime(), datetime_to_date(), dt_new_by_frags(), dup_obj_as_complex(), and get_c_df().

#define have_df_p | ( |  | x | ) | ((x)->flags & HAVE_DF)

Definition at line 156 of file date_core.c.

Referenced by d_complex_new_internal(), get_c_df(), get_c_time(), local_df(), and local_jd().

#define HAVE_JD (1 << 0)

Definition at line 149 of file date_core.c.

Referenced by d_lite_marshal_load(), d_lite_plus(), d_lite_s_alloc_complex(), d_lite_s_alloc_simple(), d_new_by_frags(), date_s_civil(), date_s_commercial(), date_s_jd(), date_s_ordinal(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_ordinal(), dt_new_by_frags(), get_c_jd(), and get_s_jd().

#define have_jd_p | ( |  | x | ) | ((x)->flags & HAVE_JD)

Definition at line 155 of file date_core.c.

Referenced by d_complex_new_internal(), d_lite_cmp(), d_lite_equal(), d_simple_new_internal(), get_c_civil(), get_c_jd(), get_s_civil(), get_s_jd(), and local_jd().

#define HAVE_TIME (1 << 3)

Definition at line 152 of file date_core.c.

Referenced by clear_civil(), d_lite_plus(), date_to_datetime(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_now(), datetime_s_ordinal(), datetime_to_date(), get_c_time(), and time_to_datetime().

#define have_time_p | ( |  | x | ) | ((x)->flags & HAVE_TIME)

Definition at line 158 of file date_core.c.

Referenced by d_complex_new_internal(), get_c_df(), and get_c_time().

#define HOUR_IN_SECONDS 3600

Definition at line 171 of file date_core.c.

Referenced by df_to_time(), rt_rewrite_frags(), and time_to_df().

#define HOUR_SHIFT (MIN_WIDTH + SEC_WIDTH)

Definition at line 197 of file date_core.c.

#define HOUR_WIDTH 5

Definition at line 191 of file date_core.c.

#define ITALY 2299161 /* 1582-10-15 */

Definition at line 162 of file date_core.c.

Referenced by d_lite_italy(), and Init_date_core().

#define JC_PERIOD0 1461 /* 365.25 * 4 */

Definition at line 176 of file date_core.c.

#define jd_trunc d_trunc

Definition at line 3124 of file date_core.c.

#define JULIAN positive_inf

Definition at line 164 of file date_core.c.

Referenced by d_lite_julian(), and Init_date_core().

#define k_trunc d_trunc

Definition at line 3125 of file date_core.c.

#define MDAY_SHIFT (HOUR_WIDTH + MIN_WIDTH + SEC_WIDTH)

Definition at line 198 of file date_core.c.

Referenced by d_lite_equal().

#define MDAY_WIDTH 5

Definition at line 192 of file date_core.c.

#define MILLISECOND_IN_NANOSECONDS 1000000

Definition at line 6792 of file date_core.c.

Referenced by tmx_m_msecs().

#define MIN_SHIFT SEC_WIDTH

Definition at line 196 of file date_core.c.

#define MIN_WIDTH 6

Definition at line 190 of file date_core.c.

#define MINUTE_IN_SECONDS 60

Definition at line 170 of file date_core.c.

Referenced by df_to_time(), rt_rewrite_frags(), and time_to_df().

#define MOD | ( |  | n,
|  |  | d
| ) |  | ((n)<0 ? NMOD((n),(d)) : (n)%(d))

Definition at line 147 of file date_core.c.

Referenced by c_commercial_to_jd(), c_gregorian_leap_p(), c_jd_to_commercial(), c_jd_to_wday(), c_jd_to_weeknum(), c_julian_leap_p(), c_weeknum_to_jd(), d_lite_plus(), d_lite_rshift(), decode_year(), and vm_init_redefined_flag().

#define MON_SHIFT (MDAY_WIDTH + HOUR_WIDTH + MIN_WIDTH + SEC_WIDTH)

Definition at line 199 of file date_core.c.

#define MON_WIDTH 4

Definition at line 193 of file date_core.c.

#define NDEBUG

Definition at line 10 of file date_core.c.

#define NDIV | ( |  | x,
|  |  | y
| ) |  | (-(-((x)+1)/(y))-1)

Definition at line 144 of file date_core.c.

#define NMOD | ( |  | x,
|  |  | y
| ) |  | ((y)-(-((x)+1)%(y))-1)

Definition at line 145 of file date_core.c.

#define num2int_with_frac | ( |  | s,
|  |  | n
| ) |  |

Value:
{\
s = NUM2INT(s##_trunc(v##s, &fr));\
if (f_nonzero_p(fr)) {\
if (argc > n)\
rb_raise(rb_eArgError, "invalid fraction");\
fr2 = fr;\
}\
}

Definition at line 3188 of file date_core.c.

Referenced by date_s_civil(), date_s_commercial(), date_s_ordinal(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), and datetime_s_ordinal().

#define num2num_with_frac | ( |  | s,
|  |  | n
| ) |  |

Value:
{\
s = s##_trunc(v##s, &fr);\
if (f_nonzero_p(fr)) {\
if (argc > n)\
rb_raise(rb_eArgError, "invalid fraction");\
fr2 = fr;\
}\
}

Definition at line 3178 of file date_core.c.

Referenced by date_s_jd(), and datetime_s_jd().

#define PACK2 | ( |  | m,
|  |  | d
| ) |  | (((m) << MON_SHIFT) | ((d) << MDAY_SHIFT))

Definition at line 213 of file date_core.c.

Referenced by get_s_civil().

#define PACK5 | ( |  | m,
|  |  | d,
|  |  | h,
|  |  | min,
|  |  | s
| ) |  |

Value:
(((m) << MON_SHIFT) | ((d) << MDAY_SHIFT) |\
((h) << HOUR_SHIFT) | ((min) << MIN_SHIFT) | ((s) << SEC_SHIFT))

Definition at line 209 of file date_core.c.

Referenced by date_to_datetime(), get_c_civil(), and get_c_time().

#define PK_MASK | ( |  | x | ) | ((1 << (x)) - 1)

Definition at line 201 of file date_core.c.

#define rb_intern | ( |  | str | ) | rb_intern_const(str)

#define ref_hash | ( |  | k | ) | rb_hash_aref(hash, ID2SYM(rb_intern(k)))

Definition at line 3662 of file date_core.c.

Referenced by d_new_by_frags(), date_s__parse_internal(), date_s__strptime_internal(), dt_new_by_frags(), rt__valid_date_frags_p(), rt_complete_frags(), and rt_rewrite_frags().

#define ref_hash0 | ( |  | k | ) | rb_hash_aref(hash, k)

Definition at line 3658 of file date_core.c.

Referenced by rt_complete_frags().

#define REFORM_BEGIN_JD 2298874 /* ns 1582-01-01 */

Definition at line 185 of file date_core.c.

#define REFORM_BEGIN_YEAR 1582

Definition at line 183 of file date_core.c.

Referenced by guess_style().

#define REFORM_END_JD 2426355 /* os 1930-12-31 */

Definition at line 186 of file date_core.c.

Referenced by c_valid_start_p().

#define REFORM_END_YEAR 1930

Definition at line 184 of file date_core.c.

Referenced by guess_style().

#define SEC_SHIFT 0

Definition at line 195 of file date_core.c.

#define SEC_WIDTH 6

Definition at line 189 of file date_core.c.

#define SECOND_IN_MILLISECONDS 1000

Definition at line 173 of file date_core.c.

Referenced by sec_to_ms().

#define SECOND_IN_NANOSECONDS 1000000000

Definition at line 174 of file date_core.c.

Referenced by d_lite_plus(), Init_date_core(), minus_dd(), ns_to_sec(), old_to_new(), and sec_to_ns().

#define set_hash | ( |  | k,
|  |  | v
| ) |  | rb_hash_aset(hash, ID2SYM(rb_intern(k)), v)

Definition at line 3661 of file date_core.c.

Referenced by date_s__parse_internal(), date_s__strptime_internal(), dt_new_by_frags(), rt_complete_frags(), and rt_rewrite_frags().

#define set_hash0 | ( |  | k,
|  |  | v
| ) |  | rb_hash_aset(hash, k, v)

Definition at line 3657 of file date_core.c.

Referenced by rt_complete_frags().

#define set_to_complex | ( |  | x,
|  |  | _nth,
|  |  | _jd,
|  |  | _df,
|  |  | _sf,
|  |  | _of,
|  |  | _sg,
|  |  | _year,
|  |  | _mon,
|  |  | _mday,
|  |  | _hour,
|  |  | _min,
|  |  | _sec,
|  |  | _flags
| ) |  |

Value:
{\
(x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->df = _df;\
(x)->sf = canon(_sf);\
(x)->of = _of;\
(x)->sg = (sg_cast)(_sg);\
(x)->year = _year;\
(x)->pc = PACK5(_mon, _mday, _hour, _min, _sec);\
(x)->flags = _flags;\
}

Definition at line 365 of file date_core.c.

Referenced by d_complex_new_internal(), and d_lite_marshal_load().

#define set_to_simple | ( |  | x,
|  |  | _nth,
|  |  | _jd,
|  |  | _sg,
|  |  | _year,
|  |  | _mon,
|  |  | _mday,
|  |  | _flags
| ) |  |

Value:
{\
(x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->sg = (sg_cast)(_sg);\
(x)->year = _year;\
(x)->pc = PACK2(_mon, _mday);\
(x)->flags = _flags;\
}

Definition at line 335 of file date_core.c.

Referenced by d_lite_marshal_load(), and d_simple_new_internal().

#define simple_dat_p | ( |  | x | ) | (!complex_dat_p(x))

Definition at line 160 of file date_core.c.

Referenced by clear_civil(), d_lite_cmp(), d_lite_day_fraction(), d_lite_gc_mark(), d_lite_initialize_copy(), d_lite_plus(), date_to_datetime(), datetime_to_date(), dup_obj(), dup_obj_as_complex(), get_s_civil(), get_s_jd(), m_ajd(), m_amjd(), m_df(), m_fr(), m_hour(), m_jd(), m_julian_p(), m_local_df(), m_local_jd(), m_mday(), m_min(), m_mon(), m_nth(), m_of(), m_pc(), m_sec(), m_sf(), m_sg(), m_virtual_sg(), m_year(), m_zone(), set_sg(), tmx_m_msecs(), and tmx_m_secs().

#define SMALLBUF 100

Definition at line 6740 of file date_core.c.

Referenced by date_strftime_alloc(), date_strftime_internal(), and strftimev().

#define sym | ( |  | x | ) | ID2SYM(rb_intern(x))

Definition at line 3697 of file date_core.c.

Referenced by cbsubst_sym_to_subst(), iseq_build_from_ary_body(), list_i(), mnew(), rb_call_inits(), rb_dlcfunc_set_calltype(), rb_dlptr_initialize(), rb_dlptr_s_malloc(), recursive_list_access(), register_label(), rt_complete_frags(), sym_to_proc(), sym_to_sym(), vm_call_method(), and w_symbol().

#define UNIX_EPOCH_IN_CJD INT2FIX(2440588) /* 1970-01-01 */

Definition at line 168 of file date_core.c.

Referenced by rt_rewrite_frags(), and tmx_m_secs().

#define USE_PACK

Definition at line 17 of file date_core.c.

Referenced by d_lite_plus().

#define val2off | ( |  | vof,
|  |  | iof
| ) |  |

Value:
{\
if (!offset_to_sec(vof, &iof)) {\
iof = 0;\
rb_warning("invalid offset is ignored");\
}\
}

Definition at line 4681 of file date_core.c.

Referenced by d_lite_new_offset(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), and datetime_s_ordinal().

#define val2sg | ( |  | vsg,
|  |  | dsg
| ) |  |

Value:
{\
dsg = NUM2DBL(vsg);\
if (!c_valid_start_p(dsg)) {\
dsg = DEFAULT_SG;\
rb_warning("invalid start is ignored");\
}\
}

Definition at line 3212 of file date_core.c.

Referenced by d_lite_new_start(), date_s_civil(), date_s_commercial(), date_s_jd(), date_s_ordinal(), date_s_today(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), and datetime_s_ordinal().

#define valid_sg | ( |  | sg | ) |

Value:
{\
if (!c_valid_start_p(sg)) {\
sg = 0;\
rb_warning("invalid start is ignored");\
}\
}

Definition at line 2393 of file date_core.c.

Referenced by valid_civil_sub(), valid_commercial_sub(), valid_jd_sub(), and valid_ordinal_sub().

## Function Documentation

static void c_civil_to_jd | ( | int | y,
|  | int | m,
|  | int | d,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 487 of file date_core.c.

References ComplexDateData::jd.

Referenced by c_valid_civil_p(), d_lite_leap_p(), get_c_jd(), get_s_jd(), and valid_civil_p().

static void c_commercial_to_jd | ( | int | y,
|  | int | w,
|  | int | d,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 561 of file date_core.c.

References c_find_fdoy(), MOD, and ComplexDateData::sg.

Referenced by c_jd_to_commercial(), and c_valid_commercial_p().

static int c_find_fdoy | ( | int | y,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 441 of file date_core.c.

References c_valid_civil_p().

Referenced by c_commercial_to_jd(), c_jd_to_ordinal(), c_jd_to_weeknum(), c_ordinal_to_jd(), and c_weeknum_to_jd().

static int c_find_ldom | ( | int | y,
|  | int | m,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 476 of file date_core.c.

References c_valid_civil_p(), and i.

Referenced by c_valid_civil_p().

static int c_find_ldoy | ( | int | y,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 452 of file date_core.c.

References c_valid_civil_p(), and i.

Referenced by c_valid_ordinal_p().

static int c_gregorian_last_day_of_month | ( | int | y,
|  | int | m
| ) |  |

static

Definition at line 704 of file date_core.c.

References assert, and c_gregorian_leap_p().

Referenced by c_valid_gregorian_p().

static int c_gregorian_leap_p | ( | int | y | ) |

inline static

Definition at line 691 of file date_core.c.

References MOD.

Referenced by c_gregorian_last_day_of_month(), c_gregorian_to_yday(), d_lite_leap_p(), and date_s_gregorian_leap_p().

static int c_gregorian_to_yday | ( | int | y,
|  | int | m,
|  | int | d
| ) |  |

static

Definition at line 1755 of file date_core.c.

References assert, and c_gregorian_leap_p().

Referenced by m_yday().

static void c_jd_to_civil | ( | int | jd,
|  | double | sg,
|  | int * | ry,
|  | int * | rm,
|  | int * | rdom
| ) |  |

static

Definition at line 511 of file date_core.c.

References ComplexDateData::jd.

Referenced by c_jd_to_commercial(), c_jd_to_ordinal(), c_jd_to_weeknum(), c_valid_civil_p(), d_lite_leap_p(), get_c_civil(), and get_s_civil().

static void c_jd_to_commercial | ( | int | jd,
|  | double | sg,
|  | int * | ry,
|  | int * | rw,
|  | int * | rd
| ) |  |

static

Definition at line 575 of file date_core.c.

References c_commercial_to_jd(), c_jd_to_civil(), DIV, and MOD.

Referenced by c_valid_commercial_p(), m_cweek(), and m_cwyear().

static void c_jd_to_ordinal | ( | int | jd,
|  | double | sg,
|  | int * | ry,
|  | int * | rd
| ) |  |

static

Definition at line 551 of file date_core.c.

References c_find_fdoy(), and c_jd_to_civil().

Referenced by c_valid_ordinal_p(), and m_yday().

static int c_jd_to_wday | ( | int | jd | ) |

inline static

Definition at line 638 of file date_core.c.

References MOD.

Referenced by m_wday().

static void c_jd_to_weeknum | ( | int | jd,
|  | int | f,
|  | double | sg,
|  | int * | ry,
|  | int * | rw,
|  | int * | rd
| ) |  |

static

Definition at line 606 of file date_core.c.

References c_find_fdoy(), c_jd_to_civil(), DIV, and MOD.

Referenced by c_valid_weeknum_p(), and m_wnumx().

static int c_julian_last_day_of_month | ( | int | y,
|  | int | m
| ) |  |

static

Definition at line 697 of file date_core.c.

References assert, and c_julian_leap_p().

Referenced by c_valid_julian_p().

static int c_julian_leap_p | ( | int | y | ) |

inline static

Definition at line 685 of file date_core.c.

References MOD.

Referenced by c_julian_last_day_of_month(), c_julian_to_yday(), and date_s_julian_leap_p().

static int c_julian_to_yday | ( | int | y,
|  | int | m,
|  | int | d
| ) |  |

static

Definition at line 1748 of file date_core.c.

References assert, and c_julian_leap_p().

Referenced by m_yday().

static void c_ordinal_to_jd | ( | int | y,
|  | int | d,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 541 of file date_core.c.

References c_find_fdoy(), and ComplexDateData::sg.

Referenced by c_valid_ordinal_p().

static int c_valid_civil_p | ( | int | y,
|  | int | m,
|  | int | d,
|  | double | sg,
|  | int * | rm,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 749 of file date_core.c.

References c_civil_to_jd(), c_find_ldom(), and c_jd_to_civil().

Referenced by c_find_fdoy(), c_find_ldom(), c_find_ldoy(), and valid_civil_p().

static int c_valid_commercial_p | ( | int | y,
|  | int | w,
|  | int | d,
|  | double | sg,
|  | int * | rw,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 772 of file date_core.c.

References c_commercial_to_jd(), and c_jd_to_commercial().

Referenced by valid_commercial_p().

static int c_valid_gregorian_p | ( | int | y,
|  | int | m,
|  | int | d,
|  | int * | rm,
|  | int * | rd
| ) |  |

static

Definition at line 730 of file date_core.c.

References c_gregorian_last_day_of_month(), and last.

Referenced by valid_civil_p(), and valid_gregorian_p().

static int c_valid_julian_p | ( | int | y,
|  | int | m,
|  | int | d,
|  | int * | rm,
|  | int * | rd
| ) |  |

static

Definition at line 711 of file date_core.c.

References c_julian_last_day_of_month(), and last.

Referenced by valid_civil_p().

static int c_valid_ordinal_p | ( | int | y,
|  | int | d,
|  | double | sg,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 657 of file date_core.c.

References c_find_ldoy(), c_jd_to_ordinal(), and c_ordinal_to_jd().

Referenced by valid_ordinal_p().

static int c_valid_start_p | ( | double | sg | ) |

inline static

Definition at line 868 of file date_core.c.

References isinf(), isnan, and REFORM_END_JD.

Referenced by d_new_by_frags(), dt_new_by_frags(), and old_to_new().

static int c_valid_time_p | ( | int | h,
|  | int | min,
|  | int | s,
|  | int * | rh,
|  | int * | rmin,
|  | int * | rs
| ) |  |

static

Definition at line 850 of file date_core.c.

References min().

Referenced by datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_ordinal(), and dt_new_by_frags().

static int c_valid_weeknum_p | ( | int | y,
|  | int | w,
|  | int | d,
|  | int | f,
|  | double | sg,
|  | int * | rw,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 796 of file date_core.c.

References c_jd_to_weeknum(), and c_weeknum_to_jd().

Referenced by valid_weeknum_p().

static double c_virtual_sg | ( | union DateData * | x | ) |

inline static

Definition at line 1092 of file date_core.c.

References DateData::c, f_negative_p(), f_zero_p(), isinf(), negative_inf, ComplexDateData::nth, positive_inf, and ComplexDateData::sg.

Referenced by get_c_civil(), get_c_jd(), m_julian_p(), and m_virtual_sg().

static void c_weeknum_to_jd | ( | int | y,
|  | int | w,
|  | int | d,
|  | int | f,
|  | double | sg,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 595 of file date_core.c.

References c_find_fdoy(), MOD, and ComplexDateData::sg.

Referenced by c_valid_weeknum_p().

static VALUE canon | ( | VALUE | x | ) |

inline static

Definition at line 313 of file date_core.c.

References FIX2LONG, FIXNUM_P, RRATIONAL, T_RATIONAL, and TYPE.

static void clear_civil | ( | union DateData * | x | ) |

static

Definition at line 5356 of file date_core.c.

References DateData::c, SimpleDateData::flags, ComplexDateData::flags, HAVE_CIVIL, HAVE_TIME, SimpleDateData::pc, ComplexDateData::pc, DateData::s, simple_dat_p, SimpleDateData::year, and ComplexDateData::year.

Referenced by set_of(), and set_sg().

static VALUE cmp_dd | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6292 of file date_core.c.

References f_eqeq_p(), f_lt_p(), get_d2, INT2FIX, m_df(), m_jd(), m_nth(), and m_sf().

Referenced by d_lite_cmp().

static VALUE cmp_gen | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6280 of file date_core.c.

References f_ajd, f_cmp(), get_d1, k_date_p(), k_numeric_p(), m_ajd(), rb_intern, and rb_num_coerce_cmp().

Referenced by d_lite_cmp().

static VALUE d_complex_new_internal | ( | VALUE | klass,
|  | VALUE | nth,
|  | int | jd,
|  | int | df,
|  | VALUE | sf,
|  | int | of,
|  | double | sg,
|  | int | y,
|  | int | m,
|  | int | d,
|  | int | h,
|  | int | min,
|  | int | s,
|  | unsigned | flags
| ) |  |

inline static

Definition at line 2948 of file date_core.c.

References assert, COMPLEX_DAT, d_lite_gc_mark(), Data_Make_Struct, have_civil_p, have_df_p, have_jd_p, have_time_p, and set_to_complex.

Referenced by d_lite_plus(), d_lite_s_alloc_complex(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_now(), datetime_s_ordinal(), dt_new_by_frags(), and time_to_datetime().

static VALUE d_lite_ajd | ( | VALUE | self | ) |

static

Definition at line 4803 of file date_core.c.

References get_d1, and m_ajd().

Referenced by Init_date_core().

static VALUE d_lite_amjd | ( | VALUE | self | ) |

static

Definition at line 4822 of file date_core.c.

References get_d1, and m_amjd().

Referenced by Init_date_core().

static VALUE d_lite_asctime | ( | VALUE | self | ) |

static

Definition at line 7116 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_cmp | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6365 of file date_core.c.

References cmp_dd(), cmp_gen(), f_eqeq_p(), f_lt_p(), get_d2, have_jd_p, INT2FIX, k_date_p(), m_gregorian_p(), m_jd(), m_mday(), m_mon(), m_nth(), m_pc(), m_year(), and simple_dat_p.

Referenced by d_lite_downto(), d_lite_eql_p(), d_lite_step(), d_lite_upto(), and Init_date_core().

static VALUE d_lite_cwday | ( | VALUE | self | ) |

static

Definition at line 5020 of file date_core.c.

References get_d1, INT2FIX, and m_cwday().

Referenced by Init_date_core().

static VALUE d_lite_cweek | ( | VALUE | self | ) |

static

Definition at line 5003 of file date_core.c.

References get_d1, INT2FIX, and m_cweek().

Referenced by Init_date_core().

static VALUE d_lite_cwyear | ( | VALUE | self | ) |

static

Definition at line 4986 of file date_core.c.

References get_d1, and m_real_cwyear().

Referenced by Init_date_core().

static VALUE d_lite_day_fraction | ( | VALUE | self | ) |

static

Definition at line 4966 of file date_core.c.

References get_d1, INT2FIX, m_fr(), and simple_dat_p.

Referenced by Init_date_core().

static VALUE d_lite_downto | ( | VALUE | self,
|  | VALUE | min
| ) |  |

static

Definition at line 6265 of file date_core.c.

References d_lite_cmp(), d_lite_plus(), FIX2INT, INT2FIX, rb_yield(), and RETURN_ENUMERATOR.

Referenced by Init_date_core().

static VALUE d_lite_england | ( | VALUE | self | ) |

static

Definition at line 5454 of file date_core.c.

References dup_obj_with_new_start(), and ENGLAND.

Referenced by Init_date_core().

static VALUE d_lite_eql_p | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6576 of file date_core.c.

References d_lite_cmp(), f_zero_p(), k_date_p(), and Qfalse.

Referenced by Init_date_core().

static VALUE d_lite_equal | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6507 of file date_core.c.

References equal_gen(), f_eqeq_p(), get_d2, have_jd_p, k_date_p(), m_gregorian_p(), m_local_jd(), m_mday(), m_mon(), m_nth(), m_pc(), m_year(), MDAY_SHIFT, Qfalse, and Qtrue.

Referenced by Init_date_core().

static VALUE d_lite_friday_p | ( | VALUE | self | ) |

static

Definition at line 5131 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static void d_lite_gc_mark | ( | union DateData * | dat | ) |

static

Definition at line 2917 of file date_core.c.

References DateData::c, SimpleDateData::nth, ComplexDateData::nth, rb_gc_mark(), DateData::s, ComplexDateData::sf, and simple_dat_p.

Referenced by d_complex_new_internal(), and d_simple_new_internal().

static VALUE d_lite_gregorian | ( | VALUE | self | ) |

static

Definition at line 5478 of file date_core.c.

References dup_obj_with_new_start(), and GREGORIAN.

Referenced by Init_date_core().

static VALUE d_lite_gregorian_p | ( | VALUE | self | ) |

static

Definition at line 5305 of file date_core.c.

References f_boolcast, get_d1, and m_gregorian_p().

Referenced by Init_date_core().

static VALUE d_lite_hash | ( | VALUE | self | ) |

static

Definition at line 6585 of file date_core.c.

References get_d1, LONG2FIX, m_df(), m_jd(), m_nth(), m_sf(), rb_memhash(), and v.

Referenced by Init_date_core().

static VALUE d_lite_hour | ( | VALUE | self | ) |

static

Definition at line 5181 of file date_core.c.

References get_d1, INT2FIX, and m_hour().

Referenced by Init_date_core().

static VALUE d_lite_httpdate | ( | VALUE | self | ) |

static

Definition at line 7167 of file date_core.c.

References dup_obj_with_new_offset(), set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_initialize_copy | ( | VALUE | copy,
|  | VALUE | date
| ) |  |

static

Definition at line 4748 of file date_core.c.

References COMPLEX_DAT, complex_dat_p, get_d2, rb_eArgError, rb_raise(), and simple_dat_p.

Referenced by Init_date_core().

static VALUE d_lite_inspect | ( | VALUE | self | ) |

static

Definition at line 6723 of file date_core.c.

References f_to_s, get_d1, mk_inspect(), RB_GC_GUARD, rb_obj_classname(), and RSTRING_PTR.

Referenced by Init_date_core().

static VALUE d_lite_iso8601 | ( | VALUE | self | ) |

static

Definition at line 7129 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_italy | ( | VALUE | self | ) |

static

Definition at line 5442 of file date_core.c.

References dup_obj_with_new_start(), and ITALY.

Referenced by Init_date_core().

static VALUE d_lite_jd | ( | VALUE | self | ) |

static

Definition at line 4841 of file date_core.c.

References get_d1, and m_real_local_jd().

Referenced by Init_date_core(), and rt_complete_frags().

static VALUE d_lite_jisx0301 | ( | VALUE | self | ) |

static

Definition at line 7210 of file date_core.c.

References tmx::dat, get_d1, jisx0301_date(), m_real_local_jd(), m_real_year(), RSTRING_PTR, set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_julian | ( | VALUE | self | ) |

static

Definition at line 5466 of file date_core.c.

References dup_obj_with_new_start(), and JULIAN.

Referenced by Init_date_core().

static VALUE d_lite_julian_p | ( | VALUE | self | ) |

static

Definition at line 5287 of file date_core.c.

References f_boolcast, get_d1, and m_julian_p().

Referenced by Init_date_core().

static VALUE d_lite_ld | ( | VALUE | self | ) |

static

Definition at line 4878 of file date_core.c.

References f_sub, get_d1, INT2FIX, and m_real_local_jd().

Referenced by Init_date_core().

static VALUE d_lite_leap_p | ( | VALUE | self | ) |

static

Definition at line 5323 of file date_core.c.

References c_civil_to_jd(), c_gregorian_leap_p(), c_jd_to_civil(), f_boolcast, get_d1, m_gregorian_p(), m_virtual_sg(), and m_year().

Referenced by Init_date_core().

static VALUE d_lite_lshift | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6106 of file date_core.c.

References d_lite_rshift(), and f_negate.

Referenced by d_lite_prev_month(), d_lite_prev_year(), and Init_date_core().

static VALUE d_lite_marshal_dump | ( | VALUE | self | ) |

static

Definition at line 7244 of file date_core.c.

References tmx::dat, DBL2NUM, FL_EXIVAR, FL_SET, FL_TEST, get_d1, INT2FIX, m_df(), m_jd(), m_nth(), m_of(), m_sf(), m_sg(), rb_ary_new3(), and rb_copy_generic_ivar().

Referenced by Init_date_core().

static VALUE d_lite_marshal_load | ( | VALUE | self,
|  | VALUE | a
| ) |  |

static

Definition at line 7268 of file date_core.c.

References COMPLEX_DAT, complex_dat_p, tmx::dat, f_zero_p(), FL_EXIVAR, FL_SET, FL_TEST, get_d1, HAVE_DF, HAVE_JD, NUM2DBL, NUM2INT, old_to_new(), RARRAY_LEN, RARRAY_PTR, rb_copy_generic_ivar(), rb_eArgError, rb_eTypeError, rb_raise(), set_to_complex, set_to_simple, T_ARRAY, and TYPE.

Referenced by Init_date_core().

static VALUE d_lite_mday | ( | VALUE | self | ) |

static

Definition at line 4949 of file date_core.c.

References get_d1, INT2FIX, and m_mday().

Referenced by Init_date_core().

static VALUE d_lite_min | ( | VALUE | self | ) |

static

Definition at line 5199 of file date_core.c.

References get_d1, INT2FIX, and m_min().

Referenced by Init_date_core().

static VALUE d_lite_minus | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 5974 of file date_core.c.

References d_lite_plus(), DBL2NUM, f_negate, FIX2LONG, k_date_p(), k_numeric_p(), LONG2NUM, minus_dd(), rb_eTypeError, rb_raise(), RFLOAT_VALUE, T_BIGNUM, T_FIXNUM, T_FLOAT, T_RATIONAL, and TYPE.

Referenced by d_lite_prev_day(), and Init_date_core().

static VALUE d_lite_mjd | ( | VALUE | self | ) |

static

Definition at line 4860 of file date_core.c.

References f_sub, get_d1, INT2FIX, and m_real_local_jd().

Referenced by Init_date_core().

static VALUE d_lite_mon | ( | VALUE | self | ) |

static

Definition at line 4931 of file date_core.c.

References get_d1, INT2FIX, and m_mon().

Referenced by Init_date_core().

static VALUE d_lite_monday_p | ( | VALUE | self | ) |

static

Definition at line 5079 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static VALUE d_lite_new_offset | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 5517 of file date_core.c.

References dup_obj_with_new_offset(), rb_scan_args(), and val2off.

Referenced by Init_date_core().

static VALUE d_lite_new_start | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 5421 of file date_core.c.

References DEFAULT_SG, dup_obj_with_new_start(), rb_scan_args(), and val2sg.

Referenced by Init_date_core().

static VALUE d_lite_next | ( | VALUE | self | ) |

static

Definition at line 6035 of file date_core.c.

References d_lite_next_day(), and NULL.

Referenced by Init_date_core().

static VALUE d_lite_next_day | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6001 of file date_core.c.

References d_lite_plus(), INT2FIX, and rb_scan_args().

Referenced by d_lite_next(), and Init_date_core().

static VALUE d_lite_next_month | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6118 of file date_core.c.

References d_lite_rshift(), INT2FIX, and rb_scan_args().

Referenced by Init_date_core().

static VALUE d_lite_next_year | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6152 of file date_core.c.

References d_lite_rshift(), f_mul, INT2FIX, and rb_scan_args().

Referenced by Init_date_core().

static VALUE d_lite_offset | ( | VALUE | self | ) |

static

Definition at line 5252 of file date_core.c.

References get_d1, and m_of_in_day().

Referenced by Init_date_core().

static VALUE d_lite_plus | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 5550 of file date_core.c.

References CM_PERIOD, COMPLEX_DAT, d_complex_new_internal(), d_simple_new_internal(), DAY_IN_SECONDS, DBL2NUM, DIV, EX_HOUR, EX_MIN, EX_SEC, f_add, f_floor, f_ge_p(), f_idiv, f_lt_p(), f_mod, f_mul, f_negate, f_positive_p, f_sub, f_to_r, f_zero_p(), FIX2INT, FIX2LONG, get_d1, HAVE_CIVIL, HAVE_DF, HAVE_JD, HAVE_TIME, i, INT2FIX, k_numeric_p(), k_rational_p(), m_df(), m_jd(), m_nth(), m_of(), m_sf(), m_sg(), MOD, rb_eTypeError, rb_obj_class(), rb_raise(), RFLOAT_VALUE, round(), RRATIONAL, SECOND_IN_NANOSECONDS, simple_dat_p, T_BIGNUM, T_FIXNUM, T_FLOAT, T_RATIONAL, TYPE, USE_PACK, and wholenum_p().

Referenced by d_lite_downto(), d_lite_minus(), d_lite_next_day(), d_lite_rshift(), d_lite_step(), d_lite_upto(), and Init_date_core().

static VALUE d_lite_prev_day | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6018 of file date_core.c.

References d_lite_minus(), INT2FIX, and rb_scan_args().

Referenced by Init_date_core().

static VALUE d_lite_prev_month | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6135 of file date_core.c.

References d_lite_lshift(), INT2FIX, and rb_scan_args().

Referenced by Init_date_core().

static VALUE d_lite_prev_year | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6169 of file date_core.c.

References d_lite_lshift(), f_mul, INT2FIX, and rb_scan_args().

Referenced by Init_date_core().

static VALUE d_lite_rfc2822 | ( | VALUE | self | ) |

static

Definition at line 7154 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_rfc3339 | ( | VALUE | self | ) |

static

Definition at line 7141 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_rshift | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6054 of file date_core.c.

References d_lite_plus(), DIV, encode_jd(), f_add3, f_idiv, f_mod, f_mul, f_sub, FIX2INT, FIX2LONG, FIXNUM_P, get_d1, INT2FIX, LONG2NUM, m_mday(), m_mon(), m_real_local_jd(), m_real_year(), m_sg(), MOD, rb_eArgError, rb_raise(), and valid_civil_p().

Referenced by d_lite_lshift(), d_lite_next_month(), d_lite_next_year(), and Init_date_core().

static VALUE d_lite_s_alloc | ( | VALUE | klass | ) |

static

Definition at line 2993 of file date_core.c.

References d_lite_s_alloc_complex().

Referenced by Init_date_core().

static VALUE d_lite_s_alloc_complex | ( | VALUE | klass | ) |

static

Definition at line 2981 of file date_core.c.

References d_complex_new_internal(), DEFAULT_SG, HAVE_DF, HAVE_JD, and INT2FIX.

Referenced by d_lite_s_alloc(), date_to_datetime(), dup_obj(), and dup_obj_as_complex().

static VALUE d_lite_s_alloc_simple | ( | VALUE | klass | ) |

static

Definition at line 2971 of file date_core.c.

References d_simple_new_internal(), DEFAULT_SG, HAVE_JD, and INT2FIX.

Referenced by date_to_datetime(), datetime_to_date(), and dup_obj().

static VALUE d_lite_saturday_p | ( | VALUE | self | ) |

static

Definition at line 5144 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static VALUE d_lite_sec | ( | VALUE | self | ) |

static

Definition at line 5217 of file date_core.c.

References get_d1, INT2FIX, and m_sec().

Referenced by Init_date_core().

static VALUE d_lite_sec_fraction | ( | VALUE | self | ) |

static

Definition at line 5235 of file date_core.c.

References get_d1, and m_sf_in_sec().

Referenced by Init_date_core().

static VALUE d_lite_start | ( | VALUE | self | ) |

static

Definition at line 5349 of file date_core.c.

References DBL2NUM, get_d1, and m_sg().

Referenced by Init_date_core().

static VALUE d_lite_step | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 6195 of file date_core.c.

References d_lite_cmp(), d_lite_plus(), f_cmp(), f_zero_p(), FIX2INT, INT2FIX, rb_eArgError, rb_raise(), rb_scan_args(), rb_yield(), and RETURN_ENUMERATOR.

Referenced by Init_date_core().

static VALUE d_lite_strftime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 7083 of file date_core.c.

References date_strftime_internal(), and set_tmx().

Referenced by Init_date_core().

static VALUE d_lite_sunday_p | ( | VALUE | self | ) |

static

Definition at line 5066 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static VALUE d_lite_thursday_p | ( | VALUE | self | ) |

static

Definition at line 5118 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static VALUE d_lite_to_s | ( | VALUE | self | ) |

static

Definition at line 6615 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE d_lite_tuesday_p | ( | VALUE | self | ) |

static

Definition at line 5092 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static VALUE d_lite_upto | ( | VALUE | self,
|  | VALUE | max
| ) |  |

static

Definition at line 6243 of file date_core.c.

References d_lite_cmp(), d_lite_plus(), FIX2INT, INT2FIX, rb_yield(), and RETURN_ENUMERATOR.

Referenced by Init_date_core().

static VALUE d_lite_wday | ( | VALUE | self | ) |

static

Definition at line 5053 of file date_core.c.

References get_d1, INT2FIX, and m_wday().

Referenced by Init_date_core(), and rt_complete_frags().

static VALUE d_lite_wednesday_p | ( | VALUE | self | ) |

static

Definition at line 5105 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

static VALUE d_lite_yday | ( | VALUE | self | ) |

static

Definition at line 4913 of file date_core.c.

References get_d1, INT2FIX, and m_yday().

Referenced by Init_date_core().

static VALUE d_lite_year | ( | VALUE | self | ) |

static

Definition at line 4896 of file date_core.c.

References get_d1, and m_real_year().

Referenced by Init_date_core(), and rt_complete_frags().

static VALUE d_lite_zone | ( | VALUE | self | ) |

static

Definition at line 5269 of file date_core.c.

References get_d1, and m_zone().

Referenced by Init_date_core().

static VALUE d_new_by_frags | ( | VALUE | klass,
|  | VALUE | hash,
|  | VALUE | sg
| ) |  |

static

Definition at line 4108 of file date_core.c.

References c_valid_start_p(), d_simple_new_internal(), decode_jd(), DEFAULT_SG, HAVE_JD, INT2FIX, NIL_P, NUM2DBL, rb_eArgError, rb_raise(), rb_warning(), ref_hash, rt__valid_civil_p(), rt__valid_date_frags_p(), rt_complete_frags(), and rt_rewrite_frags().

Referenced by date_s_httpdate(), date_s_iso8601(), date_s_jisx0301(), date_s_parse(), date_s_rfc2822(), date_s_rfc3339(), date_s_strptime(), and date_s_xmlschema().

static VALUE d_simple_new_internal | ( | VALUE | klass,
|  | VALUE | nth,
|  | int | jd,
|  | double | sg,
|  | int | y,
|  | int | m,
|  | int | d,
|  | unsigned | flags
| ) |  |

inline static

Definition at line 2929 of file date_core.c.

References assert, COMPLEX_DAT, d_lite_gc_mark(), Data_Make_Struct, have_civil_p, have_jd_p, and set_to_simple.

Referenced by d_lite_plus(), d_lite_s_alloc_simple(), d_new_by_frags(), date_s_civil(), date_s_commercial(), date_s_jd(), date_s_ordinal(), date_s_today(), and time_to_date().

static VALUE d_trunc | ( | VALUE | d,
|  | VALUE * | fr
| ) |  |

inline static

Definition at line 3109 of file date_core.c.

References f_idiv, f_mod, INT2FIX, to_integer(), and wholenum_p().

VALUE date__httpdate | ( | VALUE |  | ) |

Definition at line 2330 of file date_parse.c.

References hash(), httpdate_type1(), httpdate_type2(), httpdate_type3(), rb_backref_get(), rb_backref_set(), rb_hash_new(), and rb_match_busy().

Referenced by date_s__httpdate().

VALUE date__iso8601 | ( | VALUE |  | ) |

Definition at line 1899 of file date_parse.c.

References hash(), iso8601_bas_datetime(), iso8601_bas_time(), iso8601_ext_datetime(), iso8601_ext_time(), rb_backref_get(), rb_backref_set(), rb_hash_new(), and rb_match_busy().

Referenced by date__jisx0301(), and date_s__iso8601().

VALUE date__jisx0301 | ( | VALUE |  | ) |

Definition at line 2404 of file date_parse.c.

References date__iso8601(), hash(), jisx0301(), rb_backref_get(), rb_backref_set(), rb_hash_new(), and rb_match_busy().

Referenced by date_s__jisx0301().

VALUE date__parse | ( | VALUE | str,
|  | VALUE | comp
| ) |  |

Definition at line 1540 of file date_parse.c.

References asp_string, date_zone_to_diff(), del_hash, f_add, f_ge_p, f_gsub_bang, f_le_p, hash(), HAVE_ALPHA, HAVE_DASH, HAVE_DIGIT, HAVE_DOT, HAVE_ELEM_P, HAVE_SLASH, INT2FIX, NIL_P, parse_bc(), parse_day(), parse_ddd(), parse_dot(), parse_eu(), parse_frag(), parse_iso(), parse_iso2(), parse_jis(), parse_mday(), parse_mon(), parse_sla(), parse_time(), parse_us(), parse_vms(), parse_year(), Qnil, rb_backref_get(), rb_backref_set(), rb_hash_new(), rb_match_busy(), rb_str_dup(), ref_hash, REGCOMP_0, RTEST, and set_hash.

Referenced by date_s__parse_internal().

VALUE date__rfc2822 | ( | VALUE |  | ) |

Definition at line 2184 of file date_parse.c.

References hash(), rb_backref_get(), rb_backref_set(), rb_hash_new(), rb_match_busy(), and rfc2822().

Referenced by date_s__rfc2822().

VALUE date__rfc3339 | ( | VALUE |  | ) |

Definition at line 1967 of file date_parse.c.

References hash(), rb_backref_get(), rb_backref_set(), rb_hash_new(), rb_match_busy(), and rfc3339().

Referenced by date_s__rfc3339().

VALUE date__strptime | ( | const char * | str,
|  | size_t | slen,
|  | const char * | fmt,
|  | size_t | flen,
|  | VALUE | hash
| ) |  |

Definition at line 648 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, and set_hash.

Referenced by date_s__strptime_internal().

VALUE date__xmlschema | ( | VALUE |  | ) |

Definition at line 2113 of file date_parse.c.

References hash(), rb_backref_get(), rb_backref_set(), rb_hash_new(), rb_match_busy(), xmlschema_datetime(), xmlschema_time(), and xmlschema_trunc().

Referenced by date_s__xmlschema().

static VALUE date_s__httpdate | ( | VALUE | klass,
|  | VALUE | str
| ) |  |

static

Definition at line 4553 of file date_core.c.

References date__httpdate().

Referenced by date_s_httpdate(), datetime_s_httpdate(), and Init_date_core().

static VALUE date_s__iso8601 | ( | VALUE | klass,
|  | VALUE | str
| ) |  |

static

Definition at line 4376 of file date_core.c.

References date__iso8601().

Referenced by date_s_iso8601(), datetime_s_iso8601(), and Init_date_core().

static VALUE date_s__jisx0301 | ( | VALUE | klass,
|  | VALUE | str
| ) |  |

static

Definition at line 4598 of file date_core.c.

References date__jisx0301().

Referenced by date_s_jisx0301(), datetime_s_jisx0301(), and Init_date_core().

static VALUE date_s__parse | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4314 of file date_core.c.

References date_s__parse_internal().

Referenced by date_s_parse(), datetime_s_parse(), and Init_date_core().

static VALUE date_s__parse_internal | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4271 of file date_core.c.

References date__parse(), hash(), NIL_P, OBJ_INFECT, Qtrue, rb_eArgError, rb_enc_copy(), rb_enc_str_asciicompat_p, rb_raise(), rb_scan_args(), ref_hash, set_hash, and StringValue.

Referenced by date_s__parse().

static VALUE date_s__rfc2822 | ( | VALUE | klass,
|  | VALUE | str
| ) |  |

static

Definition at line 4508 of file date_core.c.

References date__rfc2822().

Referenced by date_s_rfc2822(), datetime_s_rfc2822(), and Init_date_core().

static VALUE date_s__rfc3339 | ( | VALUE | klass,
|  | VALUE | str
| ) |  |

static

Definition at line 4421 of file date_core.c.

References date__rfc3339().

Referenced by date_s_rfc3339(), datetime_s_rfc3339(), and Init_date_core().

static VALUE date_s__strptime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4218 of file date_core.c.

References date_s__strptime_internal().

Referenced by date_s_strptime(), datetime_s_strptime(), and Init_date_core().

static VALUE date_s__strptime_internal | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass,
|  | const char * | default_fmt
| ) |  |

static

Definition at line 4153 of file date_core.c.

References date__strptime(), hash(), NIL_P, OBJ_INFECT, Qnil, rb_eArgError, rb_enc_copy(), rb_enc_str_asciicompat_p, rb_hash_new(), rb_raise(), rb_scan_args(), ref_hash, RSTRING_LEN, RSTRING_PTR, set_hash, StringValue, and strlen().

Referenced by date_s__strptime(), and datetime_s__strptime().

static VALUE date_s__xmlschema | ( | VALUE | klass,
|  | VALUE | str
| ) |  |

static

Definition at line 4464 of file date_core.c.

References date__xmlschema().

Referenced by date_s_xmlschema(), datetime_s_xmlschema(), and Init_date_core().

static VALUE date_s_civil | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 3361 of file date_core.c.

References add_frac, d_simple_new_internal(), DEFAULT_SG, guess_style(), HAVE_CIVIL, HAVE_JD, INT2FIX, ComplexDateData::nth, NUM2INT, num2int_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), ComplexDateData::sg, val2sg, valid_civil_p(), and valid_gregorian_p().

Referenced by Init_date_core().

static VALUE date_s_commercial | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 3440 of file date_core.c.

References add_frac, d_simple_new_internal(), DEFAULT_SG, HAVE_JD, INT2FIX, ComplexDateData::nth, NUM2INT, num2int_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), ComplexDateData::sg, val2sg, and valid_commercial_p().

Referenced by Init_date_core().

static VALUE date_s_gregorian_leap_p | ( | VALUE | klass,
|  | VALUE | y
| ) |  |

static

Definition at line 2907 of file date_core.c.

References c_gregorian_leap_p(), decode_year(), f_boolcast, and ComplexDateData::nth.

Referenced by Init_date_core().

static VALUE date_s_httpdate | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4572 of file date_core.c.

References d_new_by_frags(), date_s__httpdate(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_iso8601 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4395 of file date_core.c.

References d_new_by_frags(), date_s__iso8601(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_jd | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 3239 of file date_core.c.

References add_frac, d_simple_new_internal(), decode_jd(), DEFAULT_SG, HAVE_JD, INT2FIX, ComplexDateData::jd, ComplexDateData::nth, num2num_with_frac, positive_inf, rb_scan_args(), ComplexDateData::sg, and val2sg.

Referenced by Init_date_core().

static VALUE date_s_jisx0301 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4615 of file date_core.c.

References d_new_by_frags(), date_s__jisx0301(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_julian_leap_p | ( | VALUE | klass,
|  | VALUE | y
| ) |  |

static

Definition at line 2884 of file date_core.c.

References c_julian_leap_p(), decode_year(), f_boolcast, and ComplexDateData::nth.

Referenced by Init_date_core().

static VALUE date_s_ordinal | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 3291 of file date_core.c.

References add_frac, d_simple_new_internal(), DEFAULT_SG, HAVE_JD, INT2FIX, ComplexDateData::nth, num2int_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), ComplexDateData::sg, val2sg, and valid_ordinal_p().

Referenced by Init_date_core().

static VALUE date_s_parse | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4337 of file date_core.c.

References d_new_by_frags(), date_s__parse(), DEFAULT_SG, hash(), INT2FIX, Qtrue, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_rfc2822 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4527 of file date_core.c.

References d_new_by_frags(), date_s__rfc2822(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_rfc3339 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4438 of file date_core.c.

References d_new_by_frags(), date_s__rfc3339(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_strptime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4243 of file date_core.c.

References d_new_by_frags(), date_s__strptime(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE date_s_today | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 3618 of file date_core.c.

References d_simple_new_internal(), decode_year(), DEFAULT_SG, get_d1, GREGORIAN, HAVE_CIVIL, INT2FIX, localtime_r(), rb_scan_args(), rb_sys_fail(), set_sg(), time_t, and val2sg.

Referenced by Init_date_core(), and rt_complete_frags().

static VALUE date_s_valid_civil_p | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 2532 of file date_core.c.

References DEFAULT_SG, INT2FIX, NIL_P, Qfalse, Qtrue, rb_scan_args(), and valid_civil_sub().

Referenced by Init_date_core().

static VALUE date_s_valid_commercial_p | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 2699 of file date_core.c.

References DEFAULT_SG, INT2FIX, NIL_P, Qfalse, Qtrue, rb_scan_args(), and valid_commercial_sub().

Referenced by Init_date_core().

static VALUE date_s_valid_jd_p | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 2441 of file date_core.c.

References DEFAULT_SG, INT2FIX, NIL_P, Qfalse, Qtrue, rb_scan_args(), and valid_jd_sub().

Referenced by Init_date_core().

static VALUE date_s_valid_ordinal_p | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 2615 of file date_core.c.

References DEFAULT_SG, INT2FIX, NIL_P, Qfalse, Qtrue, rb_scan_args(), and valid_ordinal_sub().

Referenced by Init_date_core().

static VALUE date_s_xmlschema | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 4481 of file date_core.c.

References d_new_by_frags(), date_s__xmlschema(), DEFAULT_SG, hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

size_t date_strftime | ( | char * | s,
|  | size_t | maxsize,
|  | const char * | format,
|  | const struct tmx * | tmx
| ) |  |

Definition at line 807 of file date_strftime.c.

References date_strftime_with_tmx().

Referenced by date_strftime_alloc().

static size_t date_strftime_alloc | ( | char ** | buf,
|  | const char * | format,
|  | struct tmx * | tmx
| ) |  |

static

Definition at line 6742 of file date_core.c.

References date_strftime(), errno, len, rb_sys_fail(), size, SMALLBUF, strlen(), xfree(), and xmalloc.

Referenced by date_strftime_internal(), and strftimev().

static VALUE date_strftime_internal | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self,
|  | const char * | default_fmt,
|  | void(*)(VALUE, struct tmx *) | func
| ) |  |

static

Definition at line 6850 of file date_core.c.

References buf, date_strftime_alloc(), len, OBJ_INFECT, p, rb_eArgError, rb_enc_copy(), rb_enc_str_asciicompat_p, rb_raise(), rb_scan_args(), rb_str_cat(), rb_str_new(), rb_usascii_str_new2(), RSTRING_LEN, RSTRING_PTR, SMALLBUF, StringValue, strlen(), and xfree().

Referenced by d_lite_strftime(), and dt_lite_strftime().

static VALUE date_to_date | ( | VALUE | self | ) |

static

Definition at line 8738 of file date_core.c.

Referenced by Init_date_core().

static VALUE date_to_datetime | ( | VALUE | self | ) |

static

Definition at line 8750 of file date_core.c.

References cDateTime, d_lite_s_alloc_complex(), d_lite_s_alloc_simple(), EX_MDAY, EX_MON, get_d1a, get_d1b, HAVE_DF, HAVE_TIME, INT2FIX, PACK5, and simple_dat_p.

Referenced by Init_date_core().

static VALUE date_to_time | ( | VALUE | self | ) |

static

Definition at line 8721 of file date_core.c.

References f_local3, get_d1, INT2FIX, m_mday(), m_mon(), m_real_year(), and rb_cTime.

Referenced by Init_date_core().

VALUE date_zone_to_diff | ( | VALUE |  | ) |

Definition at line 370 of file date_parse.c.

Referenced by date__parse(), date__strptime_internal(), iso8601_bas_datetime_cb(), iso8601_ext_datetime_cb(), iso8601_ext_time_cb(), jisx0301_cb(), offset_to_sec(), parse_ddd_cb(), rfc2822_cb(), rfc3339_cb(), xmlschema_datetime_cb(), xmlschema_time_cb(), and xmlschema_trunc_cb().

static VALUE datetime_s__strptime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8021 of file date_core.c.

References date_s__strptime_internal().

Referenced by Init_date_core().

static VALUE datetime_s_civil | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 7506 of file date_core.c.

References add_frac, c_valid_time_p(), canon24oc, d_complex_new_internal(), DEFAULT_SG, guess_style(), HAVE_CIVIL, HAVE_JD, HAVE_TIME, INT2FIX, jd_local_to_utc(), min(), NUM2INT, num2int_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), time_to_df(), val2off, val2sg, valid_civil_p(), and valid_gregorian_p().

Referenced by Init_date_core().

static VALUE datetime_s_commercial | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 7605 of file date_core.c.

References add_frac, c_valid_time_p(), canon24oc, d_complex_new_internal(), DEFAULT_SG, HAVE_JD, HAVE_TIME, INT2FIX, jd_local_to_utc(), min(), NUM2INT, num2int_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), time_to_df(), val2off, val2sg, and valid_commercial_p().

Referenced by Init_date_core().

static VALUE datetime_s_httpdate | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8271 of file date_core.c.

References date_s__httpdate(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_iso8601 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8142 of file date_core.c.

References date_s__iso8601(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_jd | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 7358 of file date_core.c.

References add_frac, c_valid_time_p(), canon24oc, d_complex_new_internal(), decode_jd(), DEFAULT_SG, HAVE_JD, HAVE_TIME, INT2FIX, jd_local_to_utc(), min(), num2int_with_frac, num2num_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), time_to_df(), val2off, and val2sg.

Referenced by Init_date_core().

static VALUE datetime_s_jisx0301 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8303 of file date_core.c.

References date_s__jisx0301(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_now | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 7821 of file date_core.c.

References d_complex_new_internal(), DAY_IN_SECONDS, decode_year(), DEFAULT_SG, get_d1, gettimeofday(), gmtime_r(), GREGORIAN, HAVE_CIVIL, HAVE_TIME, INT2FIX, localtime_r(), long, LONG2NUM, min(), NULL, NUM2DBL, rb_scan_args(), rb_sys_fail(), rb_warning(), set_sg(), time_t, timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, and timeval::tv_usec.

Referenced by Init_date_core().

static VALUE datetime_s_ordinal | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 7428 of file date_core.c.

References add_frac, c_valid_time_p(), canon24oc, d_complex_new_internal(), DEFAULT_SG, HAVE_JD, HAVE_TIME, INT2FIX, jd_local_to_utc(), min(), num2int_with_frac, positive_inf, rb_eArgError, rb_raise(), rb_scan_args(), time_to_df(), val2off, val2sg, and valid_ordinal_p().

Referenced by Init_date_core().

static VALUE datetime_s_parse | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8100 of file date_core.c.

References date_s__parse(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, Qtrue, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_rfc2822 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8239 of file date_core.c.

References date_s__rfc2822(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_rfc3339 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8174 of file date_core.c.

References date_s__rfc3339(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_strptime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8055 of file date_core.c.

References date_s__strptime(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_s_xmlschema | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 8206 of file date_core.c.

References date_s__xmlschema(), DEFAULT_SG, dt_new_by_frags(), hash(), INT2FIX, rb_scan_args(), and rb_str_new2().

Referenced by Init_date_core().

static VALUE datetime_to_date | ( | VALUE | self | ) |

static

Definition at line 8817 of file date_core.c.

References cDate, COMPLEX_DAT, copy_complex_to_simple, d_lite_s_alloc_simple(), get_d1a, get_d1b, HAVE_DF, HAVE_TIME, m_local_jd(), and simple_dat_p.

Referenced by Init_date_core().

static VALUE datetime_to_datetime | ( | VALUE | self | ) |

static

Definition at line 8849 of file date_core.c.

Referenced by Init_date_core().

static VALUE datetime_to_time | ( | VALUE | self | ) |

static

Definition at line 8790 of file date_core.c.

References dup_obj_with_new_offset(), f_add, f_getlocal, f_utc6, get_d1, INT2FIX, m_hour(), m_mday(), m_min(), m_mon(), m_real_year(), m_sec(), m_sf_in_sec(), and rb_cTime.

Referenced by Init_date_core().

static VALUE day_to_sec | ( | VALUE | d | ) |

static

Definition at line 1000 of file date_core.c.

References DAY_IN_SECONDS, f_mul, FIX2LONG, INT2FIX, LONG2FIX, and safe_mul_p().

Referenced by div_df(), offset_to_sec(), old_to_new(), and tmx_m_secs().

static void decode_day | ( | VALUE | d,
|  | VALUE * | jd,
|  | VALUE * | df,
|  | VALUE * | sf
| ) |  |

static

Definition at line 1070 of file date_core.c.

References div_day(), div_df(), and sec_to_ns().

Referenced by old_to_new().

static void decode_jd | ( | VALUE | jd,
|  | VALUE * | nth,
|  | int * | rjd
| ) |  |

static

Definition at line 1326 of file date_core.c.

References assert, CM_PERIOD, f_idiv, f_mod, f_zero_p(), FIX2INT, FIXNUM_P, INT2FIX, RB_TYPE_P, and T_BIGNUM.

Referenced by d_new_by_frags(), date_s_jd(), datetime_s_jd(), dt_new_by_frags(), old_to_new(), valid_civil_p(), valid_commercial_p(), valid_ordinal_p(), and valid_weeknum_p().

static void decode_year | ( | VALUE | y,
|  | double | style,
|  | VALUE * | nth,
|  | int * | ry
| ) |  |

static

Definition at line 1275 of file date_core.c.

References CM_PERIOD_GCY, CM_PERIOD_JCY, DIV, f_add, f_idiv, f_mod, f_nonzero_p, FIX2INT, FIX2LONG, FIXNUM_MAX, FIXNUM_P, INT2FIX, LONG2FIX, and MOD.

Referenced by date_s_gregorian_leap_p(), date_s_julian_leap_p(), date_s_today(), datetime_s_now(), time_to_date(), time_to_datetime(), valid_civil_p(), valid_commercial_p(), valid_gregorian_p(), valid_ordinal_p(), and valid_weeknum_p().

static int df_local_to_utc | ( | int | df,
|  | int | of
| ) |  |

inline static

Definition at line 880 of file date_core.c.

References DAY_IN_SECONDS, ComplexDateData::df, and ComplexDateData::of.

Referenced by dt_new_by_frags(), and get_c_df().

static void df_to_time | ( | int | df,
|  | int * | h,
|  | int * | min,
|  | int * | s
| ) |  |

inline static

Definition at line 930 of file date_core.c.

References HOUR_IN_SECONDS, and MINUTE_IN_SECONDS.

Referenced by get_c_time().

static int df_utc_to_local | ( | int | df,
|  | int | of
| ) |  |

inline static

Definition at line 891 of file date_core.c.

References DAY_IN_SECONDS, ComplexDateData::df, and ComplexDateData::of.

Referenced by get_c_time(), and local_df().

static VALUE div_day | ( | VALUE | d,
|  | VALUE * | f
| ) |  |

static

Definition at line 1040 of file date_core.c.

References f_floor, f_mod, and INT2FIX.

Referenced by decode_day().

static VALUE div_df | ( | VALUE | d,
|  | VALUE * | f
| ) |  |

static

Definition at line 1048 of file date_core.c.

References day_to_sec(), f_floor, f_mod, and INT2FIX.

Referenced by decode_day().

static VALUE dt_lite_iso8601 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 8560 of file date_core.c.

References f_add, INT2FIX, iso8601_timediv(), rb_scan_args(), set_tmx(), and strftimev().

Referenced by dt_lite_rfc3339(), and Init_date_core().

static VALUE dt_lite_jisx0301 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 8604 of file date_core.c.

References get_d1, INT2FIX, iso8601_timediv(), jisx0301_date(), m_real_local_jd(), m_real_year(), rb_scan_args(), rb_str_append(), RSTRING_PTR, set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE dt_lite_rfc3339 | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 8586 of file date_core.c.

References dt_lite_iso8601().

Referenced by Init_date_core().

static VALUE dt_lite_strftime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 8518 of file date_core.c.

References date_strftime_internal(), and set_tmx().

Referenced by Init_date_core().

static VALUE dt_lite_to_s | ( | VALUE | self | ) |

static

Definition at line 8335 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

static VALUE dt_new_by_frags | ( | VALUE | klass,
|  | VALUE | hash,
|  | VALUE | sg
| ) |  |

static

Definition at line 7925 of file date_core.c.

References c_valid_start_p(), c_valid_time_p(), d_complex_new_internal(), DAY_IN_SECONDS, decode_jd(), DEFAULT_SG, df_local_to_utc(), f_gt_p(), HAVE_DF, HAVE_JD, INT2FIX, jd_local_to_utc(), NIL_P, NUM2DBL, NUM2INT, rb_eArgError, rb_raise(), rb_warning(), ref_hash, rt__valid_civil_p(), rt__valid_date_frags_p(), rt_complete_frags(), rt_rewrite_frags(), sec_to_ns(), set_hash, and time_to_df().

Referenced by datetime_s_httpdate(), datetime_s_iso8601(), datetime_s_jisx0301(), datetime_s_parse(), datetime_s_rfc2822(), datetime_s_rfc3339(), datetime_s_strptime(), and datetime_s_xmlschema().

static VALUE dup_obj | ( | VALUE | self | ) |

static

Definition at line 4635 of file date_core.c.

References d_lite_s_alloc_complex(), d_lite_s_alloc_simple(), get_d1a, get_d1b, rb_obj_class(), and simple_dat_p.

Referenced by dup_obj_with_new_start().

static VALUE dup_obj_as_complex | ( | VALUE | self | ) |

static

Definition at line 4658 of file date_core.c.

References COMPLEX_DAT, copy_simple_to_complex, d_lite_s_alloc_complex(), get_d1a, get_d1b, HAVE_DF, rb_obj_class(), and simple_dat_p.

Referenced by dup_obj_with_new_offset().

static VALUE dup_obj_with_new_offset | ( | VALUE | obj,
|  | int | of
| ) |  |

static

Definition at line 5494 of file date_core.c.

References dup_obj_as_complex(), get_d1, and set_of().

Referenced by d_lite_httpdate(), d_lite_new_offset(), and datetime_to_time().

static VALUE dup_obj_with_new_start | ( | VALUE | obj,
|  | double | sg
| ) |  |

static

Definition at line 5399 of file date_core.c.

References dup_obj(), get_d1, and set_sg().

Referenced by d_lite_england(), d_lite_gregorian(), d_lite_italy(), d_lite_julian(), and d_lite_new_start().

static void encode_jd | ( | VALUE | nth,
|  | int | jd,
|  | VALUE * | rjd
| ) |  |

static

Definition at line 1339 of file date_core.c.

References CM_PERIOD, f_add, f_mul, f_zero_p(), and INT2FIX.

Referenced by d_lite_rshift(), m_real_jd(), m_real_local_jd(), rt__valid_civil_p(), rt__valid_commercial_p(), rt__valid_ordinal_p(), rt__valid_weeknum_p(), valid_civil_sub(), valid_commercial_sub(), and valid_ordinal_sub().

static void encode_year | ( | VALUE | nth,
|  | int | y,
|  | double | style,
|  | VALUE * | ry
| ) |  |

static

Definition at line 1307 of file date_core.c.

References CM_PERIOD_GCY, CM_PERIOD_JCY, f_add, f_mul, f_zero_p(), and INT2FIX.

Referenced by m_real_cwyear(), and m_real_year().

static VALUE equal_gen | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 6476 of file date_core.c.

References f_eqeq_p(), f_jd, get_d1, k_date_p(), k_numeric_p(), m_real_local_jd(), rb_intern, and rb_num_coerce_cmp().

Referenced by d_lite_equal().

static VALUE f_cmp | ( | VALUE | x,
|  | VALUE | y
| ) |  |

inline static

Definition at line 51 of file date_core.c.

References FIX2LONG, FIXNUM_P, id_cmp, INT2FIX, and rb_funcall().

Referenced by cmp_gen(), and d_lite_step().

static VALUE f_eqeq_p | ( | VALUE | x,
|  | VALUE | y
| ) |  |

inline static

Definition at line 97 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, rb_funcall(), and rb_intern.

Referenced by cmp_dd(), d_lite_cmp(), d_lite_equal(), equal_gen(), float_rationalize(), nucomp_eqeq_p(), nucomp_eql_p(), nurat_eqeq_p(), nurat_rationalize(), offset_to_sec(), old_to_new(), and rt__valid_date_frags_p().

static VALUE f_ge_p | ( | VALUE | x,
|  | VALUE | y
| ) |  |

inline static

Definition at line 89 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, rb_funcall(), and rb_intern.

Referenced by d_lite_plus(), minus_dd(), and old_to_new().

static VALUE f_gt_p | ( | VALUE | x,
|  | VALUE | y
| ) |  |

inline static

Definition at line 73 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, and rb_funcall().

Referenced by dt_new_by_frags(), iso8601_timediv(), and rt_complete_frags().

static VALUE f_kind_of_p | ( | VALUE | x,
|  | VALUE | c
| ) |  |

inline static

Definition at line 1928 of file date_core.c.

References rb_obj_is_kind_of().

Referenced by k_date_p(), k_datetime_p(), k_numeric_p(), and k_rational_p().

static VALUE f_le_p | ( | VALUE | x,
|  | VALUE | y
| ) |  |

inline static

Definition at line 81 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, id_le_p, and rb_funcall().

Referenced by rt_complete_frags().

static VALUE f_lt_p | ( | VALUE | x,
|  | VALUE | y
| ) |  |

inline static

Definition at line 65 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, and rb_funcall().

Referenced by cmp_dd(), d_lite_cmp(), d_lite_plus(), jisx0301_date(), minus_dd(), and old_to_new().

static VALUE f_negative_p | ( | VALUE | x | ) |

inline static

Definition at line 124 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, INT2FIX, and rb_funcall().

Referenced by c_virtual_sg(), f_gcd(), f_muldiv(), f_signbit(), float_rationalize(), nurat_rationalize(), nurat_round(), nurat_truncate(), and s_virtual_sg().

static VALUE f_zero_p | ( | VALUE | x | ) |

inline static

Definition at line 105 of file date_core.c.

References f_boolcast, FIX2LONG, FIXNUM_P, id_eqeq_p, INT2FIX, Qfalse, rb_funcall(), RRATIONAL, T_BIGNUM, T_FIXNUM, T_RATIONAL, and TYPE.

Referenced by c_virtual_sg(), d_lite_eql_p(), d_lite_marshal_load(), d_lite_plus(), d_lite_step(), decode_jd(), encode_jd(), encode_year(), m_real_cwyear(), m_real_year(), minus_dd(), rt__valid_date_frags_p(), s_virtual_sg(), valid_civil_p(), valid_commercial_p(), valid_ordinal_p(), and valid_weeknum_p().

static void get_c_civil | ( | union DateData * | x | ) |

inline static

Definition at line 1229 of file date_core.c.

References assert, DateData::c, c_jd_to_civil(), c_virtual_sg(), complex_dat_p, ComplexDateData::df, EX_HOUR, EX_MIN, EX_SEC, ComplexDateData::flags, get_c_df(), HAVE_CIVIL, have_civil_p, have_jd_p, ComplexDateData::jd, jd_utc_to_local(), min(), ComplexDateData::of, PACK5, ComplexDateData::pc, and ComplexDateData::year.

Referenced by m_mday(), m_mon(), m_nth(), m_pc(), and m_year().

static void get_c_df | ( | union DateData * | x | ) |

inline static

Definition at line 1153 of file date_core.c.

References assert, DateData::c, complex_dat_p, ComplexDateData::df, df_local_to_utc(), EX_HOUR, EX_MIN, EX_SEC, ComplexDateData::flags, HAVE_DF, have_df_p, have_time_p, ComplexDateData::of, ComplexDateData::pc, and time_to_df().

Referenced by get_c_civil(), m_df(), m_local_df(), m_local_jd(), set_of(), and set_sg().

static void get_c_jd | ( | union DateData * | x | ) |

inline static

Definition at line 1197 of file date_core.c.

References assert, DateData::c, c_civil_to_jd(), c_virtual_sg(), complex_dat_p, EX_HOUR, EX_MDAY, EX_MIN, EX_MON, EX_SEC, ComplexDateData::flags, get_c_time(), have_civil_p, HAVE_JD, have_jd_p, ComplexDateData::jd, jd_local_to_utc(), ComplexDateData::of, ComplexDateData::pc, time_to_df(), and ComplexDateData::year.

Referenced by m_jd(), m_julian_p(), m_local_jd(), m_of(), m_sg(), set_of(), and set_sg().

static void get_c_time | ( | union DateData * | x | ) |

inline static

Definition at line 1172 of file date_core.c.

References assert, DateData::c, complex_dat_p, ComplexDateData::df, df_to_time(), df_utc_to_local(), EX_MDAY, EX_MON, ComplexDateData::flags, have_df_p, HAVE_TIME, have_time_p, min(), ComplexDateData::of, PACK5, and ComplexDateData::pc.

Referenced by get_c_jd(), m_hour(), m_min(), m_pc(), and m_sec().

static void get_s_civil | ( | union DateData * | x | ) |

inline static

Definition at line 1133 of file date_core.c.

References assert, c_jd_to_civil(), SimpleDateData::flags, HAVE_CIVIL, have_civil_p, have_jd_p, SimpleDateData::jd, PACK2, SimpleDateData::pc, DateData::s, s_virtual_sg(), simple_dat_p, and SimpleDateData::year.

Referenced by m_mday(), m_mon(), m_pc(), and m_year().

static void get_s_jd | ( | union DateData * | x | ) |

inline static

Definition at line 1113 of file date_core.c.

References assert, c_civil_to_jd(), EX_MDAY, EX_MON, SimpleDateData::flags, have_civil_p, HAVE_JD, have_jd_p, SimpleDateData::jd, ComplexDateData::jd, SimpleDateData::pc, DateData::s, s_virtual_sg(), simple_dat_p, and SimpleDateData::year.

Referenced by m_jd(), m_julian_p(), m_local_jd(), and set_sg().

static struct tm* gmtime_r | ( | const time_t * | t,
|  | struct tm * | tm
| ) |  |

static read

Definition at line 3587 of file date_core.c.

Referenced by datetime_s_now().

static double guess_style | ( | VALUE | y,
|  | double | sg
| ) |  |

inline static

Definition at line 1349 of file date_core.c.

References assert, f_positive_p, FIX2LONG, FIXNUM_P, isinf(), negative_inf, positive_inf, REFORM_BEGIN_YEAR, REFORM_END_YEAR, and ComplexDateData::sg.

Referenced by date_s_civil(), datetime_s_civil(), valid_civil_p(), valid_civil_sub(), valid_commercial_p(), valid_ordinal_p(), and valid_weeknum_p().

static VALUE h_trunc | ( | VALUE | h,
|  | VALUE * | fr
| ) |  |

inline static

Definition at line 3128 of file date_core.c.

References f_idiv, f_mod, f_quo, INT2FIX, to_integer(), and wholenum_p().

void Init_date_core | ( | void |  | ) |

Definition at line 9200 of file date_core.c.

References assert, cDate, cDateTime, CLASS_OF, d_lite_ajd(), d_lite_amjd(), d_lite_asctime(), d_lite_cmp(), d_lite_cwday(), d_lite_cweek(), d_lite_cwyear(), d_lite_day_fraction(), d_lite_downto(), d_lite_england(), d_lite_eql_p(), d_lite_equal(), d_lite_friday_p(), d_lite_gregorian(), d_lite_gregorian_p(), d_lite_hash(), d_lite_hour(), d_lite_httpdate(), d_lite_initialize_copy(), d_lite_inspect(), d_lite_iso8601(), d_lite_italy(), d_lite_jd(), d_lite_jisx0301(), d_lite_julian(), d_lite_julian_p(), d_lite_ld(), d_lite_leap_p(), d_lite_lshift(), d_lite_marshal_dump(), d_lite_marshal_load(), d_lite_mday(), d_lite_min(), d_lite_minus(), d_lite_mjd(), d_lite_mon(), d_lite_monday_p(), d_lite_new_offset(), d_lite_new_start(), d_lite_next(), d_lite_next_day(), d_lite_next_month(), d_lite_next_year(), d_lite_offset(), d_lite_plus(), d_lite_prev_day(), d_lite_prev_month(), d_lite_prev_year(), d_lite_rfc2822(), d_lite_rfc3339(), d_lite_rshift(), d_lite_s_alloc(), d_lite_saturday_p(), d_lite_sec(), d_lite_sec_fraction(), d_lite_start(), d_lite_step(), d_lite_strftime(), d_lite_sunday_p(), d_lite_thursday_p(), d_lite_to_s(), d_lite_tuesday_p(), d_lite_upto(), d_lite_wday(), d_lite_wednesday_p(), d_lite_yday(), d_lite_year(), d_lite_zone(), date_s__httpdate(), date_s__iso8601(), date_s__jisx0301(), date_s__parse(), date_s__rfc2822(), date_s__rfc3339(), date_s__strptime(), date_s__xmlschema(), date_s_civil(), date_s_commercial(), date_s_gregorian_leap_p(), date_s_httpdate(), date_s_iso8601(), date_s_jd(), date_s_jisx0301(), date_s_julian_leap_p(), date_s_ordinal(), date_s_parse(), date_s_rfc2822(), date_s_rfc3339(), date_s_strptime(), date_s_today(), date_s_valid_civil_p(), date_s_valid_commercial_p(), date_s_valid_jd_p(), date_s_valid_ordinal_p(), date_s_xmlschema(), date_to_date(), date_to_datetime(), date_to_time(), datetime_s__strptime(), datetime_s_civil(), datetime_s_commercial(), datetime_s_httpdate(), datetime_s_iso8601(), datetime_s_jd(), datetime_s_jisx0301(), datetime_s_now(), datetime_s_ordinal(), datetime_s_parse(), datetime_s_rfc2822(), datetime_s_rfc3339(), datetime_s_strptime(), datetime_s_xmlschema(), datetime_to_date(), datetime_to_datetime(), datetime_to_time(), day_in_nanoseconds, DAY_IN_SECONDS, DBL2NUM, dt_lite_iso8601(), dt_lite_jisx0301(), dt_lite_rfc3339(), dt_lite_strftime(), dt_lite_to_s(), ENGLAND, f_mul, f_public, GREGORIAN, half_days_in_day, id_cmp, id_eqeq_p, id_ge_p, id_le_p, INFINITY, INT2FIX, ITALY, JULIAN, LONG2NUM, mk_ary_of_str(), negative_inf, positive_inf, rb_cObject, rb_cTime, rb_define_alloc_func(), rb_define_class(), rb_define_const(), rb_define_method(), rb_define_private_method(), rb_define_singleton_method(), rb_gc_register_mark_object(), rb_include_module(), rb_intern, rb_mComparable, rb_rational_new2, rb_singleton_class(), rb_undef_method(), SECOND_IN_NANOSECONDS, time_to_date(), time_to_datetime(), and time_to_time().

static VALUE isec_to_day | ( | int | s | ) |

inline static

Definition at line 947 of file date_core.c.

References INT2FIX, and sec_to_day().

Referenced by m_ajd(), m_amjd(), m_fr(), m_of_in_day(), and minus_dd().

static VALUE iso8601_timediv | ( | VALUE | self,
|  | VALUE | n
| ) |  |

static

Definition at line 8525 of file date_core.c.

References f_expt, f_gt_p(), f_quo, f_round, get_d1, INT2FIX, m_sf_in_sec(), rb_f_sprintf(), rb_str_append(), rb_usascii_str_new2(), RSTRING_PTR, set_tmx(), and strftimev().

Referenced by dt_lite_iso8601(), and dt_lite_jisx0301().

static int jd_local_to_utc | ( | int | jd,
|  | int | df,
|  | int | of
| ) |  |

inline static

Definition at line 902 of file date_core.c.

References DAY_IN_SECONDS, ComplexDateData::jd, and ComplexDateData::of.

Referenced by datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_ordinal(), dt_new_by_frags(), and get_c_jd().

static int jd_utc_to_local | ( | int | jd,
|  | int | df,
|  | int | of
| ) |  |

inline static

Definition at line 913 of file date_core.c.

References DAY_IN_SECONDS, ComplexDateData::jd, and ComplexDateData::of.

Referenced by get_c_civil(), and local_jd().

static VALUE jisx0301_date | ( | VALUE | jd,
|  | VALUE | y
| ) |  |

static

Definition at line 7174 of file date_core.c.

References f_lt_p(), f_sub, INT2FIX, rb_f_sprintf(), and rb_usascii_str_new2().

Referenced by d_lite_jisx0301(), and dt_lite_jisx0301().

static VALUE k_date_p | ( | VALUE | x | ) |

inline static

Definition at line 1934 of file date_core.c.

References cDate, and f_kind_of_p().

Referenced by cmp_gen(), d_lite_cmp(), d_lite_eql_p(), d_lite_equal(), d_lite_minus(), and equal_gen().

static VALUE k_datetime_p | ( | VALUE | x | ) |

inline static

Definition at line 1940 of file date_core.c.

References cDateTime, and f_kind_of_p().

static VALUE k_numeric_p | ( | VALUE | x | ) |

inline static

Definition at line 1946 of file date_core.c.

References f_kind_of_p(), and rb_cNumeric.

Referenced by cmp_gen(), d_lite_minus(), d_lite_plus(), equal_gen(), and offset_to_sec().

static VALUE k_rational_p | ( | VALUE | x | ) |

inline static

Definition at line 1952 of file date_core.c.

References f_kind_of_p(), and rb_cRational.

Referenced by d_lite_plus(), and offset_to_sec().

static int local_df | ( | union DateData * | x | ) |

inline static

Definition at line 1267 of file date_core.c.

References assert, DateData::c, complex_dat_p, ComplexDateData::df, df_utc_to_local(), have_df_p, and ComplexDateData::of.

Referenced by m_local_df().

static int local_jd | ( | union DateData * | x | ) |

inline static

Definition at line 1258 of file date_core.c.

References assert, DateData::c, complex_dat_p, ComplexDateData::df, have_df_p, have_jd_p, ComplexDateData::jd, jd_utc_to_local(), and ComplexDateData::of.

Referenced by m_local_jd().

static struct tm* localtime_r | ( | const time_t * | t,
|  | struct tm * | tm
| ) |  |

static read

Definition at line 3596 of file date_core.c.

Referenced by date_s_today(), and datetime_s_now().

static VALUE m_ajd | ( | union DateData * | x | ) |

static

Definition at line 1515 of file date_core.c.

References ComplexDateData::df, f_add, f_mul, f_nonzero_p, f_sub, FIX2LONG, FIXNUM_MAX, FIXNUM_P, HALF_DAYS_IN_SECONDS, INT2FIX, isec_to_day(), LONG2FIX, m_df(), m_real_jd(), m_sf(), ns_to_day(), rb_rational_new2, ComplexDateData::sf, and simple_dat_p.

Referenced by cmp_gen(), and d_lite_ajd().

static VALUE m_amjd | ( | union DateData * | x | ) |

static

Definition at line 1547 of file date_core.c.

References ComplexDateData::df, f_add, f_nonzero_p, f_sub, FIX2LONG, FIXNUM_MIN, FIXNUM_P, INT2FIX, isec_to_day(), LONG2FIX, m_df(), m_real_jd(), m_sf(), ns_to_day(), rb_rational_new1, ComplexDateData::sf, and simple_dat_p.

Referenced by d_lite_amjd().

static int m_cwday | ( | union DateData * | x | ) |

static

Definition at line 1824 of file date_core.c.

References m_wday().

Referenced by d_lite_cwday().

static int m_cweek | ( | union DateData * | x | ) |

static

Definition at line 1814 of file date_core.c.

References c_jd_to_commercial(), m_local_jd(), and m_virtual_sg().

Referenced by d_lite_cweek().

static int m_cwyear | ( | union DateData * | x | ) |

static

Definition at line 1786 of file date_core.c.

References c_jd_to_commercial(), m_local_jd(), and m_virtual_sg().

Referenced by m_real_cwyear().

static int m_df | ( | union DateData * | x | ) |

inline static

Definition at line 1434 of file date_core.c.

References DateData::c, ComplexDateData::df, get_c_df(), and simple_dat_p.

Referenced by cmp_dd(), d_lite_hash(), d_lite_marshal_dump(), d_lite_plus(), m_ajd(), m_amjd(), minus_dd(), mk_inspect(), and tmx_m_secs().

static VALUE m_fr | ( | union DateData * | x | ) |

static

Definition at line 1495 of file date_core.c.

References ComplexDateData::df, f_add, f_nonzero_p, INT2FIX, isec_to_day(), m_local_df(), m_sf(), ns_to_day(), ComplexDateData::sf, and simple_dat_p.

Referenced by d_lite_day_fraction().

static int m_gregorian_p | ( | union DateData * | x | ) |

inline static

Definition at line 1625 of file date_core.c.

References m_julian_p().

Referenced by d_lite_cmp(), d_lite_equal(), d_lite_gregorian_p(), d_lite_leap_p(), m_real_cwyear(), and m_real_year().

static int m_hour | ( | union DateData * | x | ) |

inline static

Definition at line 1857 of file date_core.c.

References DateData::c, EX_HOUR, get_c_time(), ComplexDateData::pc, and simple_dat_p.

Referenced by d_lite_hour(), and datetime_to_time().

static int m_jd | ( | union DateData * | x | ) |

inline static

Definition at line 1381 of file date_core.c.

References DateData::c, get_c_jd(), get_s_jd(), SimpleDateData::jd, ComplexDateData::jd, DateData::s, and simple_dat_p.

Referenced by cmp_dd(), d_lite_cmp(), d_lite_hash(), d_lite_marshal_dump(), d_lite_plus(), m_real_jd(), and minus_dd().

static int m_julian_p | ( | union DateData * | x | ) |

static

Definition at line 1604 of file date_core.c.

References DateData::c, c_virtual_sg(), get_c_jd(), get_s_jd(), isinf(), SimpleDateData::jd, ComplexDateData::jd, positive_inf, DateData::s, s_virtual_sg(), ComplexDateData::sg, and simple_dat_p.

Referenced by d_lite_julian_p(), and m_gregorian_p().

static int m_local_df | ( | union DateData * | x | ) |

static

Definition at line 1453 of file date_core.c.

References get_c_df(), local_df(), and simple_dat_p.

Referenced by m_fr().

static int m_local_jd | ( | union DateData * | x | ) |

static

Definition at line 1407 of file date_core.c.

References get_c_df(), get_c_jd(), get_s_jd(), SimpleDateData::jd, local_jd(), DateData::s, and simple_dat_p.

Referenced by d_lite_equal(), datetime_to_date(), m_cweek(), m_cwyear(), m_real_local_jd(), m_wday(), m_wnumx(), and m_yday().

static int m_mday | ( | union DateData * | x | ) |

inline static

Definition at line 1722 of file date_core.c.

References DateData::c, EX_MDAY, get_c_civil(), get_s_civil(), SimpleDateData::pc, ComplexDateData::pc, DateData::s, and simple_dat_p.

Referenced by d_lite_cmp(), d_lite_equal(), d_lite_mday(), d_lite_rshift(), date_to_time(), datetime_to_time(), and m_yday().

static int m_min | ( | union DateData * | x | ) |

inline static

Definition at line 1872 of file date_core.c.

References DateData::c, EX_MIN, get_c_time(), ComplexDateData::pc, and simple_dat_p.

Referenced by d_lite_min(), and datetime_to_time().

static int m_mon | ( | union DateData * | x | ) |

inline static

Definition at line 1701 of file date_core.c.

References DateData::c, EX_MON, get_c_civil(), get_s_civil(), SimpleDateData::pc, ComplexDateData::pc, DateData::s, and simple_dat_p.

Referenced by d_lite_cmp(), d_lite_equal(), d_lite_mon(), d_lite_rshift(), date_to_time(), datetime_to_time(), and m_yday().

static VALUE m_nth | ( | union DateData * | x | ) |

inline static

Definition at line 1370 of file date_core.c.

References DateData::c, get_c_civil(), SimpleDateData::nth, ComplexDateData::nth, DateData::s, and simple_dat_p.

Referenced by cmp_dd(), d_lite_cmp(), d_lite_equal(), d_lite_hash(), d_lite_marshal_dump(), d_lite_plus(), m_real_cwyear(), m_real_jd(), m_real_local_jd(), m_real_year(), and minus_dd().

static int m_of | ( | union DateData * | x | ) |

inline static

Definition at line 1576 of file date_core.c.

References DateData::c, get_c_jd(), ComplexDateData::of, and simple_dat_p.

Referenced by d_lite_marshal_dump(), d_lite_plus(), m_of_in_day(), m_zone(), mk_inspect(), and tmx_m_of().

static VALUE m_of_in_day | ( | union DateData * | x | ) |

static

Definition at line 1587 of file date_core.c.

References isec_to_day(), and m_of().

Referenced by d_lite_offset().

static int m_pc | ( | union DateData * | x | ) |

inline static

Definition at line 1686 of file date_core.c.

References DateData::c, get_c_civil(), get_c_time(), get_s_civil(), SimpleDateData::pc, ComplexDateData::pc, DateData::s, and simple_dat_p.

Referenced by d_lite_cmp(), and d_lite_equal().

static int m_proleptic_gregorian_p | ( | union DateData * | x | ) |

inline static

Definition at line 1642 of file date_core.c.

References isinf(), m_sg(), and ComplexDateData::sg.

Referenced by m_yday().

static int m_proleptic_julian_p | ( | union DateData * | x | ) |

inline static

Definition at line 1631 of file date_core.c.

References isinf(), m_sg(), and ComplexDateData::sg.

Referenced by m_yday().

static VALUE m_real_cwyear | ( | union DateData * | x | ) |

static

Definition at line 1796 of file date_core.c.

References encode_year(), f_zero_p(), INT2FIX, m_cwyear(), m_gregorian_p(), m_nth(), ComplexDateData::nth, and ComplexDateData::year.

Referenced by d_lite_cwyear().

static VALUE m_real_jd | ( | union DateData * | x | ) |

static

Definition at line 1394 of file date_core.c.

References encode_jd(), ComplexDateData::jd, m_jd(), m_nth(), and ComplexDateData::nth.

Referenced by m_ajd(), m_amjd(), mk_inspect(), and tmx_m_secs().

static VALUE m_real_local_jd | ( | union DateData * | x | ) |

static

Definition at line 1421 of file date_core.c.

References encode_jd(), ComplexDateData::jd, m_local_jd(), m_nth(), and ComplexDateData::nth.

Referenced by d_lite_jd(), d_lite_jisx0301(), d_lite_ld(), d_lite_mjd(), d_lite_rshift(), dt_lite_jisx0301(), and equal_gen().

static VALUE m_real_year | ( | union DateData * | x | ) |

static

Definition at line 1666 of file date_core.c.

References encode_year(), f_zero_p(), INT2FIX, m_gregorian_p(), m_nth(), m_year(), ComplexDateData::nth, and ComplexDateData::year.

Referenced by d_lite_jisx0301(), d_lite_rshift(), d_lite_year(), date_to_time(), datetime_to_time(), and dt_lite_jisx0301().

static int m_sec | ( | union DateData * | x | ) |

inline static

Definition at line 1887 of file date_core.c.

References DateData::c, EX_SEC, get_c_time(), ComplexDateData::pc, and simple_dat_p.

Referenced by d_lite_sec(), and datetime_to_time().

static VALUE m_sf | ( | union DateData * | x | ) |

inline static

Definition at line 1472 of file date_core.c.

References DateData::c, INT2FIX, ComplexDateData::sf, and simple_dat_p.

Referenced by cmp_dd(), d_lite_hash(), d_lite_marshal_dump(), d_lite_plus(), m_ajd(), m_amjd(), m_fr(), m_sf_in_sec(), minus_dd(), mk_inspect(), and tmx_m_msecs().

static VALUE m_sf_in_sec | ( | union DateData * | x | ) |

static

Definition at line 1489 of file date_core.c.

References m_sf(), and ns_to_sec().

Referenced by d_lite_sec_fraction(), datetime_to_time(), and iso8601_timediv().

static double m_sg | ( | union DateData * | x | ) |

inline static

Definition at line 1593 of file date_core.c.

References DateData::c, get_c_jd(), DateData::s, SimpleDateData::sg, ComplexDateData::sg, and simple_dat_p.

Referenced by d_lite_marshal_dump(), d_lite_plus(), d_lite_rshift(), d_lite_start(), m_proleptic_gregorian_p(), m_proleptic_julian_p(), and mk_inspect().

static double m_virtual_sg | ( | union DateData * | x | ) |

inline static

Definition at line 1104 of file date_core.c.

References c_virtual_sg(), s_virtual_sg(), and simple_dat_p.

Referenced by d_lite_leap_p(), m_cweek(), m_cwyear(), m_wnumx(), and m_yday().

static int m_wday | ( | union DateData * | x | ) |

static

Definition at line 1780 of file date_core.c.

References c_jd_to_wday(), and m_local_jd().

Referenced by d_lite_friday_p(), d_lite_monday_p(), d_lite_saturday_p(), d_lite_sunday_p(), d_lite_thursday_p(), d_lite_tuesday_p(), d_lite_wday(), d_lite_wednesday_p(), and m_cwday().

static int m_wnum0 | ( | union DateData * | x | ) |

static

Definition at line 1845 of file date_core.c.

References m_wnumx().

static int m_wnum1 | ( | union DateData * | x | ) |

static

Definition at line 1851 of file date_core.c.

References m_wnumx().

static int m_wnumx | ( | union DateData * | x,
|  | int | f
| ) |  |

static

Definition at line 1835 of file date_core.c.

References c_jd_to_weeknum(), m_local_jd(), and m_virtual_sg().

Referenced by m_wnum0(), and m_wnum1().

static int m_yday | ( | union DateData * | x | ) |

static

Definition at line 1762 of file date_core.c.

References c_gregorian_to_yday(), c_jd_to_ordinal(), c_julian_to_yday(), ComplexDateData::jd, m_local_jd(), m_mday(), m_mon(), m_proleptic_gregorian_p(), m_proleptic_julian_p(), m_virtual_sg(), m_year(), and ComplexDateData::sg.

Referenced by d_lite_yday().

static int m_year | ( | union DateData * | x | ) |

inline static

Definition at line 1653 of file date_core.c.

References DateData::c, get_c_civil(), get_s_civil(), DateData::s, simple_dat_p, SimpleDateData::year, and ComplexDateData::year.

Referenced by d_lite_cmp(), d_lite_equal(), d_lite_leap_p(), m_real_year(), and m_yday().

static VALUE m_zone | ( | union DateData * | x | ) |

static

Definition at line 1920 of file date_core.c.

References m_of(), of2str(), rb_usascii_str_new2(), and simple_dat_p.

Referenced by d_lite_zone(), and tmx_m_zone().

static VALUE min_trunc | ( | VALUE | min,
|  | VALUE * | fr
| ) |  |

inline static

Definition at line 3145 of file date_core.c.

References f_idiv, f_mod, f_quo, INT2FIX, to_integer(), and wholenum_p().

static VALUE minus_dd | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 5896 of file date_core.c.

References CM_PERIOD, DAY_IN_SECONDS, f_add, f_ge_p(), f_lt_p(), f_mul, f_nonzero_p, f_sub, f_zero_p(), get_d2, INT2FIX, isec_to_day(), m_df(), m_jd(), m_nth(), m_sf(), ns_to_day(), rb_rational_new1, SECOND_IN_NANOSECONDS, T_RATIONAL, and TYPE.

Referenced by d_lite_minus().

static VALUE mk_ary_of_str | ( | long | len,
|  | const char * | a[]
| ) |  |

static

Definition at line 9178 of file date_core.c.

References i, len, Qnil, rb_ary_new2(), rb_ary_push(), rb_obj_freeze(), and rb_usascii_str_new2().

Referenced by Init_date_core().

static VALUE mk_inspect | ( | union DateData * | x,
|  | const char * | klass,
|  | const char * | to_s
| ) |  |

static

Definition at line 6693 of file date_core.c.

References f_inspect, m_df(), m_of(), m_real_jd(), m_sf(), m_sg(), rb_enc_sprintf(), RB_GC_GUARD, rb_usascii_encoding(), and RSTRING_PTR.

Referenced by d_lite_inspect().

static VALUE ns_to_day | ( | VALUE | n | ) |

static

Definition at line 953 of file date_core.c.

References day_in_nanoseconds, f_quo, FIXNUM_P, and rb_rational_new2.

Referenced by m_ajd(), m_amjd(), m_fr(), and minus_dd().

static VALUE ns_to_sec | ( | VALUE | n | ) |

static

Definition at line 971 of file date_core.c.

References f_quo, FIXNUM_P, INT2FIX, rb_rational_new2, and SECOND_IN_NANOSECONDS.

Referenced by m_sf_in_sec().

static VALUE of2str | ( | int | of | ) |

static

Definition at line 1911 of file date_core.c.

References decode_offset, rb_enc_sprintf(), and rb_usascii_encoding().

Referenced by m_zone().

static int offset_to_sec | ( | VALUE | vof,
|  | int * | rof
| ) |  |

static

Definition at line 2304 of file date_core.c.

References date_zone_to_diff(), DAY_IN_SECONDS, day_to_sec(), f_eqeq_p(), f_round, f_to_r, FIX2LONG, FIXNUM_P, k_numeric_p(), k_rational_p(), rb_eTypeError, rb_raise(), rb_warning(), RFLOAT_VALUE, round(), RRATIONAL, T_FIXNUM, T_FLOAT, T_RATIONAL, T_STRING, and TYPE.

static void old_to_new | ( | VALUE | ajd,
|  | VALUE | of,
|  | VALUE | sg,
|  | VALUE * | rnth,
|  | int * | rjd,
|  | int * | rdf,
|  | VALUE * | rsf,
|  | int * | rof,
|  | double * | rsg
| ) |  |

static

Definition at line 2999 of file date_core.c.

References c_valid_start_p(), DAY_IN_SECONDS, day_to_sec(), decode_day(), decode_jd(), DEFAULT_SG, ComplexDateData::df, f_add, f_eqeq_p(), f_ge_p(), f_lt_p(), f_round, half_days_in_day, INT2FIX, ComplexDateData::jd, NUM2DBL, NUM2INT, rb_eArgError, rb_raise(), rb_warning(), SECOND_IN_NANOSECONDS, and ComplexDateData::sf.

Referenced by d_lite_marshal_load().

static VALUE rt__valid_civil_p | ( | VALUE | y,
|  | VALUE | m,
|  | VALUE | d,
|  | VALUE | sg
| ) |  |

static

Definition at line 3966 of file date_core.c.

References encode_jd(), NUM2DBL, NUM2INT, Qnil, and valid_civil_p().

Referenced by d_new_by_frags(), dt_new_by_frags(), and rt__valid_date_frags_p().

static VALUE rt__valid_commercial_p | ( | VALUE | y,
|  | VALUE | w,
|  | VALUE | d,
|  | VALUE | sg
| ) |  |

static

Definition at line 3981 of file date_core.c.

References encode_jd(), NUM2DBL, NUM2INT, Qnil, and valid_commercial_p().

Referenced by rt__valid_date_frags_p().

static VALUE rt__valid_date_frags_p | ( | VALUE | hash,
|  | VALUE | sg
| ) |  |

static

Definition at line 4011 of file date_core.c.

References f_eqeq_p(), f_mod, f_sub, f_zero_p(), INT2FIX, NIL_P, Qnil, ref_hash, rt__valid_civil_p(), rt__valid_commercial_p(), rt__valid_jd_p(), rt__valid_ordinal_p(), and rt__valid_weeknum_p().

Referenced by d_new_by_frags(), and dt_new_by_frags().

static VALUE rt__valid_jd_p | ( | VALUE | jd,
|  | VALUE | sg
| ) |  |

static

Definition at line 3945 of file date_core.c.

Referenced by rt__valid_date_frags_p().

static VALUE rt__valid_ordinal_p | ( | VALUE | y,
|  | VALUE | d,
|  | VALUE | sg
| ) |  |

static

Definition at line 3951 of file date_core.c.

References encode_jd(), NUM2DBL, NUM2INT, Qnil, and valid_ordinal_p().

Referenced by rt__valid_date_frags_p().

static VALUE rt__valid_weeknum_p | ( | VALUE | y,
|  | VALUE | w,
|  | VALUE | d,
|  | VALUE | f,
|  | VALUE | sg
| ) |  |

static

Definition at line 3996 of file date_core.c.

References encode_jd(), NUM2DBL, NUM2INT, Qnil, and valid_weeknum_p().

Referenced by rt__valid_date_frags_p().

static VALUE rt_complete_frags | ( | VALUE | klass,
|  | VALUE | hash
| ) |  |

static

Definition at line 3704 of file date_core.c.

References cDate, cDateTime, d_lite_jd(), d_lite_wday(), d_lite_year(), date_s_today(), f_add, f_gt_p(), f_le_p(), f_sub, hash(), i, INT2FIX, NIL_P, Qnil, RARRAY_LENINT, RARRAY_PTR, rb_ary_new3(), rb_funcall(), rb_gc_register_mark_object(), ref_hash, ref_hash0, set_hash, set_hash0, sym, and SYM2ID.

Referenced by d_new_by_frags(), and dt_new_by_frags().

static VALUE rt_rewrite_frags | ( | VALUE | hash | ) |

static

Definition at line 3666 of file date_core.c.

References DAY_IN_SECONDS, del_hash, f_add, f_idiv, f_mod, hash(), HOUR_IN_SECONDS, INT2FIX, min(), MINUTE_IN_SECONDS, NIL_P, ref_hash, set_hash, and UNIX_EPOCH_IN_CJD.

Referenced by d_new_by_frags(), and dt_new_by_frags().

static VALUE s_trunc | ( | VALUE | s,
|  | VALUE * | fr
| ) |  |

inline static

Definition at line 3162 of file date_core.c.

References f_idiv, f_mod, f_quo, INT2FIX, to_integer(), and wholenum_p().

static double s_virtual_sg | ( | union DateData * | x | ) |

inline static

Definition at line 1080 of file date_core.c.

References f_negative_p(), f_zero_p(), isinf(), negative_inf, SimpleDateData::nth, positive_inf, DateData::s, and SimpleDateData::sg.

Referenced by get_s_civil(), get_s_jd(), m_julian_p(), and m_virtual_sg().

static int safe_mul_p | ( | VALUE | x,
|  | long | m
| ) |  |

static

Definition at line 987 of file date_core.c.

References FIX2LONG, FIXNUM_MAX, and FIXNUM_P.

Referenced by day_to_sec(), sec_to_ms(), and sec_to_ns().

static VALUE sec_to_day | ( | VALUE | s | ) |

static

Definition at line 939 of file date_core.c.

References DAY_IN_SECONDS, f_quo, FIXNUM_P, INT2FIX, and rb_rational_new2.

Referenced by isec_to_day().

static VALUE sec_to_ms | ( | VALUE | s | ) |

static

Definition at line 1016 of file date_core.c.

References f_mul, FIX2LONG, INT2FIX, LONG2FIX, safe_mul_p(), and SECOND_IN_MILLISECONDS.

Referenced by tmx_m_msecs().

static VALUE sec_to_ns | ( | VALUE | s | ) |

static

Definition at line 1024 of file date_core.c.

References f_mul, FIX2LONG, INT2FIX, LONG2FIX, safe_mul_p(), and SECOND_IN_NANOSECONDS.

Referenced by decode_day(), dt_new_by_frags(), and time_to_datetime().

static void set_of | ( | union DateData * | x,
|  | int | of
| ) |  |

static

Definition at line 5484 of file date_core.c.

References assert, DateData::c, clear_civil(), complex_dat_p, get_c_df(), get_c_jd(), and ComplexDateData::of.

Referenced by dup_obj_with_new_offset().

static void set_sg | ( | union DateData * | x,
|  | double | sg
| ) |  |

static

Definition at line 5384 of file date_core.c.

References DateData::c, clear_civil(), get_c_df(), get_c_jd(), get_s_jd(), DateData::s, SimpleDateData::sg, ComplexDateData::sg, and simple_dat_p.

Referenced by date_s_today(), datetime_s_now(), dup_obj_with_new_start(), time_to_date(), and time_to_datetime().

static void set_tmx | ( | VALUE | self,
|  | struct tmx * | tmx
| ) |  |

static

Definition at line 6842 of file date_core.c.

References tmx::dat, tmx::funcs, get_d1, and tmx_funcs.

Referenced by d_lite_asctime(), d_lite_httpdate(), d_lite_iso8601(), d_lite_jisx0301(), d_lite_rfc2822(), d_lite_rfc3339(), d_lite_strftime(), d_lite_to_s(), dt_lite_iso8601(), dt_lite_jisx0301(), dt_lite_strftime(), dt_lite_to_s(), and iso8601_timediv().

static VALUE strftimev | ( | const char * | fmt,
|  | VALUE | self,
|  | void(*)(VALUE, struct tmx *) | func
| ) |  |

static

Definition at line 7090 of file date_core.c.

References buf, date_strftime_alloc(), len, rb_usascii_str_new(), SMALLBUF, and xfree().

Referenced by d_lite_asctime(), d_lite_httpdate(), d_lite_iso8601(), d_lite_jisx0301(), d_lite_rfc2822(), d_lite_rfc3339(), d_lite_to_s(), dt_lite_iso8601(), dt_lite_jisx0301(), dt_lite_to_s(), and iso8601_timediv().

static VALUE time_to_date | ( | VALUE | self | ) |

static

Definition at line 8650 of file date_core.c.

References cDate, d_simple_new_internal(), decode_year(), DEFAULT_SG, f_mday, f_mon, f_year, FIX2INT, get_d1, GREGORIAN, HAVE_CIVIL, and set_sg().

Referenced by Init_date_core().

static VALUE time_to_datetime | ( | VALUE | self | ) |

static

Definition at line 8680 of file date_core.c.

References cDateTime, d_complex_new_internal(), decode_year(), DEFAULT_SG, f_hour, f_mday, f_min, f_mon, f_sec, f_subsec, f_utc_offset, f_year, FIX2INT, get_d1, HAVE_CIVIL, HAVE_TIME, min(), sec_to_ns(), and set_sg().

Referenced by Init_date_core().

static int time_to_df | ( | int | h,
|  | int | min,
|  | int | s
| ) |  |

inline static

Definition at line 924 of file date_core.c.

References HOUR_IN_SECONDS, and MINUTE_IN_SECONDS.

Referenced by datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_ordinal(), dt_new_by_frags(), get_c_df(), and get_c_jd().

static VALUE time_to_time | ( | VALUE | self | ) |

static

Definition at line 8638 of file date_core.c.

References rb_funcall(), and rb_intern.

Referenced by Init_date_core().

static VALUE tmx_m_msecs | ( | union DateData * | x | ) |

static

Definition at line 6795 of file date_core.c.

References f_add, f_div, f_nonzero_p, INT2FIX, m_sf(), MILLISECOND_IN_NANOSECONDS, sec_to_ms(), simple_dat_p, and tmx_m_secs().

static VALUE tmx_m_of | ( | union DateData * | x | ) |

static

Definition at line 6809 of file date_core.c.

References INT2FIX, and m_of().

static VALUE tmx_m_secs | ( | union DateData * | x | ) |

static

Definition at line 6777 of file date_core.c.

References day_to_sec(), f_add, f_sub, INT2FIX, m_df(), m_real_jd(), simple_dat_p, and UNIX_EPOCH_IN_CJD.

Referenced by tmx_m_msecs().

static char* tmx_m_zone | ( | union DateData * | x | ) |

static

Definition at line 6815 of file date_core.c.

References m_zone(), and RSTRING_PTR.

static VALUE to_integer | ( | VALUE | x | ) |

inline static

Definition at line 3101 of file date_core.c.

References f_to_i, FIXNUM_P, RB_TYPE_P, and T_BIGNUM.

Referenced by d_trunc(), h_trunc(), min_trunc(), and s_trunc().

static int valid_civil_p | ( | VALUE | y,
|  | int | m,
|  | int | d,
|  | double | sg,
|  | VALUE * | nth,
|  | int * | ry,
|  | int * | rm,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 2174 of file date_core.c.

References c_civil_to_jd(), c_valid_civil_p(), c_valid_gregorian_p(), c_valid_julian_p(), decode_jd(), decode_year(), f_zero_p(), FIX2INT, guess_style(), INT2FIX, and ComplexDateData::jd.

Referenced by d_lite_rshift(), date_s_civil(), datetime_s_civil(), rt__valid_civil_p(), and valid_civil_sub().

static VALUE valid_civil_sub | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass,
|  | int | need_jd
| ) |  |

static

Definition at line 2460 of file date_core.c.

References encode_jd(), guess_style(), INT2FIX, ComplexDateData::nth, NUM2DBL, NUM2INT, Qnil, ComplexDateData::sg, valid_civil_p(), valid_gregorian_p(), and valid_sg.

Referenced by date_s_valid_civil_p().

static int valid_commercial_p | ( | VALUE | y,
|  | int | w,
|  | int | d,
|  | double | sg,
|  | VALUE * | nth,
|  | int * | ry,
|  | int * | rw,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 2210 of file date_core.c.

References c_valid_commercial_p(), decode_jd(), decode_year(), f_zero_p(), FIX2INT, guess_style(), INT2FIX, and ComplexDateData::jd.

Referenced by date_s_commercial(), datetime_s_commercial(), rt__valid_commercial_p(), and valid_commercial_sub().

static VALUE valid_commercial_sub | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass,
|  | int | need_jd
| ) |  |

static

Definition at line 2635 of file date_core.c.

References encode_jd(), INT2FIX, ComplexDateData::nth, NUM2DBL, NUM2INT, Qnil, ComplexDateData::sg, valid_commercial_p(), and valid_sg.

Referenced by date_s_valid_commercial_p().

static int valid_gregorian_p | ( | VALUE | y,
|  | int | m,
|  | int | d,
|  | VALUE * | nth,
|  | int * | ry,
|  | int * | rm,
|  | int * | rd
| ) |  |

static

Definition at line 2165 of file date_core.c.

References c_valid_gregorian_p(), and decode_year().

Referenced by date_s_civil(), datetime_s_civil(), and valid_civil_sub().

static VALUE valid_jd_sub | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass,
|  | int | need_jd
| ) |  |

static

Definition at line 2402 of file date_core.c.

References NUM2DBL, and valid_sg.

Referenced by date_s_valid_jd_p().

static int valid_ordinal_p | ( | VALUE | y,
|  | int | d,
|  | double | sg,
|  | VALUE * | nth,
|  | int * | ry,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 2135 of file date_core.c.

References c_valid_ordinal_p(), decode_jd(), decode_year(), f_zero_p(), FIX2INT, guess_style(), INT2FIX, and ComplexDateData::jd.

Referenced by date_s_ordinal(), datetime_s_ordinal(), rt__valid_ordinal_p(), and valid_ordinal_sub().

static VALUE valid_ordinal_sub | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass,
|  | int | need_jd
| ) |  |

static

Definition at line 2553 of file date_core.c.

References encode_jd(), INT2FIX, ComplexDateData::nth, NUM2DBL, NUM2INT, Qnil, ComplexDateData::sg, valid_ordinal_p(), and valid_sg.

Referenced by date_s_valid_ordinal_p().

static int valid_weeknum_p | ( | VALUE | y,
|  | int | w,
|  | int | d,
|  | int | f,
|  | double | sg,
|  | VALUE * | nth,
|  | int * | ry,
|  | int * | rw,
|  | int * | rd,
|  | int * | rjd,
|  | int * | ns
| ) |  |

static

Definition at line 2240 of file date_core.c.

References c_valid_weeknum_p(), decode_jd(), decode_year(), f_zero_p(), FIX2INT, guess_style(), INT2FIX, and ComplexDateData::jd.

Referenced by rt__valid_weeknum_p().

static int wholenum_p | ( | VALUE | x | ) |

inline static

Definition at line 3077 of file date_core.c.

References FIX2LONG, FIXNUM_P, RFLOAT_VALUE, round(), RRATIONAL, T_BIGNUM, T_FLOAT, T_RATIONAL, and TYPE.

Referenced by d_lite_plus(), d_trunc(), h_trunc(), min_trunc(), and s_trunc().

## Variable Documentation

const char* abbr_daynames[]

static

Initial value:
= {
"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat"
}

Definition at line 9172 of file date_core.c.

const char* abbr_monthnames[]

static

Initial value:
= {
NULL,
"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"
}

Definition at line 9160 of file date_core.c.

VALUE cDate

static

Definition at line 20 of file date_core.c.

Referenced by datetime_to_date(), Init_date_core(), k_date_p(), rt_complete_frags(), and time_to_date().

VALUE cDateTime

static

Definition at line 20 of file date_core.c.

Referenced by date_to_datetime(), Init_date_core(), k_datetime_p(), rt_complete_frags(), and time_to_datetime().

VALUE day_in_nanoseconds

static

Definition at line 21 of file date_core.c.

Referenced by Init_date_core(), and ns_to_day().

const char* daynames[]

static

Initial value:
= {
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
}

Definition at line 9167 of file date_core.c.

VALUE half_days_in_day

static

Definition at line 21 of file date_core.c.

Referenced by Init_date_core(), and old_to_new().

ID id_cmp

static

Definition at line 19 of file date_core.c.

Referenced by f_cmp(), and Init_date_core().

ID id_eqeq_p

static

Definition at line 19 of file date_core.c.

Referenced by f_zero_p(), and Init_date_core().

ID id_ge_p

static

Definition at line 19 of file date_core.c.

Referenced by Init_date_core().

ID id_le_p

static

Definition at line 19 of file date_core.c.

Referenced by f_le_p(), and Init_date_core().

const char* monthnames[]

static

Initial value:
= {
NULL,
"January", "February", "March",
"April", "May", "June",
"July", "August", "September",
"October", "November", "December"
}

Definition at line 9152 of file date_core.c.

const int monthtab[2][13]

static

Initial value:
= {
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
}

Definition at line 679 of file date_core.c.

double negative_inf

static

Definition at line 22 of file date_core.c.

Referenced by c_virtual_sg(), guess_style(), Init_date_core(), and s_virtual_sg().

double positive_inf

static

Definition at line 22 of file date_core.c.

Referenced by c_virtual_sg(), date_s_civil(), date_s_commercial(), date_s_jd(), date_s_ordinal(), datetime_s_civil(), datetime_s_commercial(), datetime_s_jd(), datetime_s_ordinal(), guess_style(), Init_date_core(), m_julian_p(), and s_virtual_sg().

struct tmx_funcs tmx_funcs

static

Initial value:
= {
(VALUE (*)(void *))m_real_year,
(int (*)(void *))m_yday,
(int (*)(void *))m_mon,
(int (*)(void *))m_mday,
(VALUE (*)(void *))m_real_cwyear,
(int (*)(void *))m_cweek,
(int (*)(void *))m_cwday,
(int (*)(void *))m_wnum0,
(int (*)(void *))m_wnum1,
(int (*)(void *))m_wday,
(int (*)(void *))m_hour,
(int (*)(void *))m_min,
(int (*)(void *))m_sec,
(VALUE (*)(void *))m_sf_in_sec,
(VALUE (*)(void *))tmx_m_secs,
(VALUE (*)(void *))tmx_m_msecs,
(VALUE (*)(void *))tmx_m_of,
(char *(*)(void *))tmx_m_zone
}

Definition at line 6820 of file date_core.c.

Referenced by set_tmx().

const int yeartab[2][13]

static

Initial value:
= {
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
{ 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
}

Definition at line 1742 of file date_core.c.