Ruby  2.0.0p648(2015-12-16revision53162)
Data Structures | Macros | Functions | Variables
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 date_sg_t   double
 
#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 canonicalize_jd(_nth, _jd)
 
#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 canonicalize_s_jd (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 canonicalize_c_jd (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 void m_canonicalize_jd (union DateData *x)
 
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 int 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 date_s__load (VALUE klass, VALUE s)
 
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

◆ add_frac

#define add_frac ( )
Value:
{\
if (f_nonzero_p(fr2))\
ret = d_lite_plus(ret, fr2);\
}
#define f_nonzero_p(x)
Definition: date_core.c:121
static VALUE d_lite_plus(VALUE, VALUE)
Definition: date_core.c:5502

Definition at line 3234 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().

◆ canon24oc

#define canon24oc ( )
Value:
{\
if (rh == 24) {\
rh = 0;\
fr2 = f_add(fr2, INT2FIX(1));\
}\
}
#define f_add(x, y)
Definition: date_core.c:28
#define INT2FIX(i)
Definition: ruby.h:241

Definition at line 3226 of file date_core.c.

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

◆ canonicalize_jd

#define canonicalize_jd (   _nth,
  _jd 
)
Value:
{\
if (_jd < 0) {\
_nth = f_sub(_nth, INT2FIX(1));\
_jd += CM_PERIOD;\
}\
if (_jd >= CM_PERIOD) {\
_nth = f_add(_nth, INT2FIX(1));\
_jd -= CM_PERIOD;\
}\
}
#define f_add(x, y)
Definition: date_core.c:28
#define f_sub(x, y)
Definition: date_core.c:29
#define INT2FIX(i)
Definition: ruby.h:241
#define CM_PERIOD
Definition: date_core.c:179

Definition at line 1107 of file date_core.c.

Referenced by canonicalize_c_jd(), canonicalize_s_jd(), d_lite_plus(), and minus_dd().

◆ CM_PERIOD

#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().

◆ CM_PERIOD0

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

Definition at line 178 of file date_core.c.

◆ CM_PERIOD_GCY

#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().

◆ CM_PERIOD_JCY

#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().

◆ COMPLEX_DAT

#define COMPLEX_DAT   (1 << 7)

◆ complex_dat_p

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

◆ copy_complex_to_simple

#define copy_complex_to_simple (   x,
 
)
Value:
{\
(x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK2(EX_MON((y)->pc), EX_MDAY((y)->pc));\
(x)->flags = (y)->flags;\
}
#define EX_MDAY(x)
Definition: date_core.c:206
#define EX_MON(x)
Definition: date_core.c:207
#define PACK2(m, d)
Definition: date_core.c:213
#define date_sg_t
Definition: date_core.c:224

Definition at line 413 of file date_core.c.

Referenced by datetime_to_date().

◆ copy_simple_to_complex

#define copy_simple_to_complex (   x,
 
)
Value:
{\
(x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->df = 0;\
(x)->sf = INT2FIX(0);\
(x)->of = 0;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK5(EX_MON((y)->pc), EX_MDAY((y)->pc), 0, 0, 0);\
(x)->flags = (y)->flags;\
}
#define PACK5(m, d, h, min, s)
Definition: date_core.c:209
#define EX_MDAY(x)
Definition: date_core.c:206
#define EX_MON(x)
Definition: date_core.c:207
#define date_sg_t
Definition: date_core.c:224
#define INT2FIX(i)
Definition: ruby.h:241

Definition at line 387 of file date_core.c.

Referenced by dup_obj_as_complex().

◆ date_sg_t

#define date_sg_t   double

Definition at line 224 of file date_core.c.

Referenced by set_sg().

◆ DAY_IN_SECONDS

#define DAY_IN_SECONDS   86400

◆ decode_offset

#define decode_offset (   of,
  s,
  h,
 
)
Value:
{\
int a;\
s = (of < 0) ? '-' : '+';\
a = (of < 0) ? -of : of;\
h = a / HOUR_IN_SECONDS;\
}
#define HOUR_IN_SECONDS
Definition: date_core.c:171
#define MINUTE_IN_SECONDS
Definition: date_core.c:170

Definition at line 1941 of file date_core.c.

Referenced by of2str().

◆ DEFAULT_SG

#define DEFAULT_SG   ITALY

◆ del_hash

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

Definition at line 3681 of file date_core.c.

Referenced by rt_rewrite_frags().

◆ del_hash0

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

Definition at line 3677 of file date_core.c.

◆ DIV

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

◆ ENGLAND

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

Definition at line 163 of file date_core.c.

Referenced by d_lite_england(), and Init_date_core().

◆ EX_HOUR

#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().

◆ EX_MDAY

#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().

◆ EX_MIN

#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().

◆ EX_MON

#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().

◆ EX_SEC

#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().

◆ f_abs

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

◆ f_add

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

◆ f_add3

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

Definition at line 47 of file date_core.c.

Referenced by d_lite_rshift().

◆ f_ajd

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

Definition at line 133 of file date_core.c.

Referenced by cmp_gen().

◆ f_boolcast

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

◆ f_ceil

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

Definition at line 38 of file date_core.c.

◆ f_div

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

Definition at line 31 of file date_core.c.

Referenced by tmx_m_msecs().

◆ f_expt

#define f_expt (   x,
 
)    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().

◆ f_floor

#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().

◆ f_getlocal

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

Definition at line 8522 of file date_core.c.

Referenced by datetime_to_time(), and time_to_time().

◆ f_hour

#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().

◆ f_idiv

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

◆ f_inspect

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

◆ f_jd

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

Definition at line 134 of file date_core.c.

Referenced by equal_gen().

◆ f_local3

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

Definition at line 8525 of file date_core.c.

Referenced by date_to_time().

◆ f_mday

#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().

◆ f_min

#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().

◆ f_mod

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

◆ f_mon

#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().

◆ f_mul

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

◆ f_negate

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

◆ f_nonzero_p

#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().

◆ f_positive_p

#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().

◆ f_public

#define f_public (   m,
 
)
Value:
rb_funcall(m, rb_intern("public"), 1,\
#define rb_intern(str)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
Definition: vm_eval.c:773
#define ID2SYM(x)
Definition: ruby.h:363

Referenced by Init_date_core().

◆ f_quo

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

◆ f_remainder

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

Definition at line 35 of file date_core.c.

◆ f_round

#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().

◆ f_sec

#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().

◆ f_sub

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

◆ f_sub3

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

Definition at line 48 of file date_core.c.

◆ f_subsec

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

Definition at line 8523 of file date_core.c.

Referenced by time_to_datetime().

◆ f_to_i

#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(), and to_integer().

◆ f_to_r

#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(), nucomp_to_r(), and offset_to_sec().

◆ f_to_s

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

◆ f_truncate

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

Definition at line 39 of file date_core.c.

◆ f_utc6

#define f_utc6 (   x,
  y,
  m,
  d,
  h,
  min,
 
)
Value:
rb_funcall(x, rb_intern("utc"), 6,\
y, m, d, h, min, s)
#define rb_intern(str)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
Definition: vm_eval.c:773

Definition at line 8526 of file date_core.c.

Referenced by datetime_to_time().

◆ f_utc_offset

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

Definition at line 8524 of file date_core.c.

Referenced by time_to_datetime().

◆ f_wday

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

Definition at line 138 of file date_core.c.

◆ f_year

#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().

◆ GC_PERIOD0

#define GC_PERIOD0   146097 /* 365.2425 * 400 */

Definition at line 177 of file date_core.c.

◆ get_d1

#define get_d1 (   x)

◆ get_d1a

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

Definition at line 288 of file date_core.c.

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

◆ get_d1b

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

Definition at line 292 of file date_core.c.

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

◆ get_d2

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

Definition at line 296 of file date_core.c.

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

◆ GREGORIAN

#define GREGORIAN   negative_inf

◆ HALF_DAYS_IN_SECONDS

#define HALF_DAYS_IN_SECONDS   (DAY_IN_SECONDS / 2)

Definition at line 1552 of file date_core.c.

Referenced by m_ajd().

◆ HAVE_CIVIL

#define HAVE_CIVIL   (1 << 2)

◆ have_civil_p

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

◆ HAVE_DF

#define HAVE_DF   (1 << 1)

◆ have_df_p

#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().

◆ HAVE_JD

#define HAVE_JD   (1 << 0)

◆ have_jd_p

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

◆ HAVE_TIME

#define HAVE_TIME   (1 << 3)

◆ have_time_p

#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().

◆ HOUR_IN_SECONDS

#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().

◆ HOUR_SHIFT

#define HOUR_SHIFT   (MIN_WIDTH + SEC_WIDTH)

Definition at line 197 of file date_core.c.

◆ HOUR_WIDTH

#define HOUR_WIDTH   5

Definition at line 191 of file date_core.c.

◆ ITALY

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

Definition at line 162 of file date_core.c.

Referenced by d_lite_italy(), and Init_date_core().

◆ JC_PERIOD0

#define JC_PERIOD0   1461 /* 365.25 * 4 */

Definition at line 176 of file date_core.c.

◆ jd_trunc

#define jd_trunc   d_trunc

Definition at line 3152 of file date_core.c.

◆ JULIAN

#define JULIAN   positive_inf

Definition at line 164 of file date_core.c.

Referenced by d_lite_julian(), d_lite_marshal_load(), and Init_date_core().

◆ k_trunc

#define k_trunc   d_trunc

Definition at line 3153 of file date_core.c.

◆ MDAY_SHIFT

#define MDAY_SHIFT   (HOUR_WIDTH + MIN_WIDTH + SEC_WIDTH)

Definition at line 198 of file date_core.c.

Referenced by d_lite_equal().

◆ MDAY_WIDTH

#define MDAY_WIDTH   5

Definition at line 192 of file date_core.c.

◆ MILLISECOND_IN_NANOSECONDS

#define MILLISECOND_IN_NANOSECONDS   1000000

Definition at line 6700 of file date_core.c.

Referenced by tmx_m_msecs().

◆ MIN_SHIFT

#define MIN_SHIFT   SEC_WIDTH

Definition at line 196 of file date_core.c.

◆ MIN_WIDTH

#define MIN_WIDTH   6

Definition at line 190 of file date_core.c.

◆ MINUTE_IN_SECONDS

#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().

◆ MOD

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

◆ MON_SHIFT

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

Definition at line 199 of file date_core.c.

◆ MON_WIDTH

#define MON_WIDTH   4

Definition at line 193 of file date_core.c.

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file date_core.c.

◆ NDIV

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

Definition at line 144 of file date_core.c.

◆ NMOD

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

Definition at line 145 of file date_core.c.

◆ num2int_with_frac

#define num2int_with_frac (   s,
 
)
Value:
{\
s = NUM2INT(s##_trunc(v##s, &fr));\
if (f_nonzero_p(fr)) {\
if (argc > n)\
rb_raise(rb_eArgError, "invalid fraction");\
fr2 = fr;\
}\
}
#define NUM2INT(x)
Definition: ruby.h:622
#define f_nonzero_p(x)
Definition: date_core.c:121
int argc
Definition: ruby.c:130
v
Definition: win32ole.c:798
struct SimpleDateData s
Definition: date_core.c:280
VALUE rb_eArgError
Definition: error.c:517

Definition at line 3216 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().

◆ num2num_with_frac

#define num2num_with_frac (   s,
 
)
Value:
{\
s = s##_trunc(v##s, &fr);\
if (f_nonzero_p(fr)) {\
if (argc > n)\
rb_raise(rb_eArgError, "invalid fraction");\
fr2 = fr;\
}\
}
#define f_nonzero_p(x)
Definition: date_core.c:121
int argc
Definition: ruby.c:130
v
Definition: win32ole.c:798
struct SimpleDateData s
Definition: date_core.c:280
VALUE rb_eArgError
Definition: error.c:517

Definition at line 3206 of file date_core.c.

Referenced by date_s_jd(), and datetime_s_jd().

◆ PACK2

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

Definition at line 213 of file date_core.c.

Referenced by get_s_civil().

◆ PACK5

#define PACK5 (   m,
  d,
  h,
  min,
 
)
Value:
(((m) << MON_SHIFT) | ((d) << MDAY_SHIFT) |\
((h) << HOUR_SHIFT) | ((min) << MIN_SHIFT) | ((s) << SEC_SHIFT))
#define MDAY_SHIFT
Definition: date_core.c:198
#define MON_SHIFT
Definition: date_core.c:199
#define SEC_SHIFT
Definition: date_core.c:195
#define HOUR_SHIFT
Definition: date_core.c:197
#define MIN_SHIFT
Definition: date_core.c:196
struct SimpleDateData s
Definition: date_core.c:280

Definition at line 209 of file date_core.c.

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

◆ PK_MASK

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

Definition at line 201 of file date_core.c.

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

◆ ref_hash

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

◆ ref_hash0

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

Definition at line 3676 of file date_core.c.

Referenced by rt_complete_frags().

◆ REFORM_BEGIN_JD

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

Definition at line 185 of file date_core.c.

◆ REFORM_BEGIN_YEAR

#define REFORM_BEGIN_YEAR   1582

Definition at line 183 of file date_core.c.

Referenced by guess_style().

◆ REFORM_END_JD

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

Definition at line 186 of file date_core.c.

Referenced by c_valid_start_p().

◆ REFORM_END_YEAR

#define REFORM_END_YEAR   1930

Definition at line 184 of file date_core.c.

Referenced by guess_style().

◆ SEC_SHIFT

#define SEC_SHIFT   0

Definition at line 195 of file date_core.c.

◆ SEC_WIDTH

#define SEC_WIDTH   6

Definition at line 189 of file date_core.c.

◆ SECOND_IN_MILLISECONDS

#define SECOND_IN_MILLISECONDS   1000

Definition at line 173 of file date_core.c.

Referenced by sec_to_ms().

◆ SECOND_IN_NANOSECONDS

#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().

◆ set_hash

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

◆ set_hash0

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

Definition at line 3675 of file date_core.c.

Referenced by rt_complete_frags().

◆ set_to_complex

#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 = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->pc = PACK5(_mon, _mday, _hour, _min, _sec);\
(x)->flags = _flags;\
}
#define PACK5(m, d, h, min, s)
Definition: date_core.c:209
unsigned flags
Definition: date_core.c:279
#define date_sg_t
Definition: date_core.c:224
static VALUE canon(VALUE x)
Definition: date_core.c:302

Definition at line 354 of file date_core.c.

Referenced by d_complex_new_internal(), and d_lite_marshal_load().

◆ set_to_simple

#define set_to_simple (   x,
  _nth,
  _jd,
  _sg,
  _year,
  _mon,
  _mday,
  _flags 
)
Value:
{\
(x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->pc = PACK2(_mon, _mday);\
(x)->flags = _flags;\
}
unsigned flags
Definition: date_core.c:279
#define PACK2(m, d)
Definition: date_core.c:213
#define date_sg_t
Definition: date_core.c:224
static VALUE canon(VALUE x)
Definition: date_core.c:302

Definition at line 324 of file date_core.c.

Referenced by d_lite_marshal_load(), and d_simple_new_internal().

◆ simple_dat_p

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

◆ SMALLBUF

#define SMALLBUF   100

Definition at line 6648 of file date_core.c.

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

◆ sym

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

◆ UNIX_EPOCH_IN_CJD

#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().

◆ USE_PACK

#define USE_PACK

Definition at line 17 of file date_core.c.

Referenced by d_lite_plus().

◆ val2off

#define val2off (   vof,
  iof 
)
Value:
{\
if (!offset_to_sec(vof, &iof)) {\
iof = 0;\
rb_warning("invalid offset is ignored");\
}\
}
static int offset_to_sec(VALUE vof, int *rof)
Definition: date_core.c:2344

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().

◆ val2sg

#define val2sg (   vsg,
  dsg 
)
Value:
{\
dsg = NUM2DBL(vsg);\
if (!c_valid_start_p(dsg)) {\
dsg = DEFAULT_SG;\
rb_warning("invalid start is ignored");\
}\
}
#define NUM2DBL(x)
Definition: ruby.h:675
#define DEFAULT_SG
Definition: date_core.c:166
static int c_valid_start_p(double sg)
Definition: date_core.c:857

Definition at line 3240 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().

◆ valid_sg

#define valid_sg (   sg)
Value:
{\
if (!c_valid_start_p(sg)) {\
sg = 0;\
rb_warning("invalid start is ignored");\
}\
}
static int c_valid_start_p(double sg)
Definition: date_core.c:857

Definition at line 2433 of file date_core.c.

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

Function Documentation

◆ c_civil_to_jd()

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

◆ c_commercial_to_jd()

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

Definition at line 550 of file date_core.c.

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

Referenced by c_jd_to_commercial(), and c_valid_commercial_p().

◆ c_find_fdoy()

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

◆ c_find_ldom()

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

Definition at line 465 of file date_core.c.

References c_valid_civil_p(), i, and ComplexDateData::sg.

Referenced by c_valid_civil_p().

◆ c_find_ldoy()

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

Definition at line 441 of file date_core.c.

References c_valid_civil_p(), i, and ComplexDateData::sg.

Referenced by c_valid_ordinal_p().

◆ c_gregorian_last_day_of_month()

static int c_gregorian_last_day_of_month ( int  y,
int  m 
)
static

Definition at line 693 of file date_core.c.

References assert, c_gregorian_leap_p(), and monthtab.

Referenced by c_valid_gregorian_p().

◆ c_gregorian_leap_p()

static int c_gregorian_leap_p ( int  y)
inlinestatic

◆ c_gregorian_to_yday()

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

Definition at line 1795 of file date_core.c.

References assert, c_gregorian_leap_p(), and yeartab.

Referenced by m_yday().

◆ c_jd_to_civil()

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

◆ c_jd_to_commercial()

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

◆ c_jd_to_ordinal()

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

Definition at line 540 of file date_core.c.

References c_find_fdoy(), c_jd_to_civil(), ComplexDateData::jd, and ComplexDateData::sg.

Referenced by c_valid_ordinal_p(), and m_yday().

◆ c_jd_to_wday()

static int c_jd_to_wday ( int  jd)
inlinestatic

Definition at line 627 of file date_core.c.

References ComplexDateData::jd, and MOD.

Referenced by m_wday().

◆ c_jd_to_weeknum()

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

Definition at line 595 of file date_core.c.

References c_find_fdoy(), c_jd_to_civil(), DIV, f, ComplexDateData::jd, MOD, and ComplexDateData::sg.

Referenced by c_valid_weeknum_p(), and m_wnumx().

◆ c_julian_last_day_of_month()

static int c_julian_last_day_of_month ( int  y,
int  m 
)
static

Definition at line 686 of file date_core.c.

References assert, c_julian_leap_p(), and monthtab.

Referenced by c_valid_julian_p().

◆ c_julian_leap_p()

static int c_julian_leap_p ( int  y)
inlinestatic

Definition at line 674 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().

◆ c_julian_to_yday()

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

Definition at line 1788 of file date_core.c.

References assert, c_julian_leap_p(), and yeartab.

Referenced by m_yday().

◆ c_ordinal_to_jd()

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

Definition at line 530 of file date_core.c.

References c_find_fdoy(), and ComplexDateData::sg.

Referenced by c_valid_ordinal_p().

◆ c_valid_civil_p()

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

◆ c_valid_commercial_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 761 of file date_core.c.

References c_commercial_to_jd(), c_jd_to_commercial(), and ComplexDateData::sg.

Referenced by valid_commercial_p().

◆ c_valid_gregorian_p()

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

Definition at line 719 of file date_core.c.

References c_gregorian_last_day_of_month(), and last.

Referenced by valid_civil_p(), and valid_gregorian_p().

◆ c_valid_julian_p()

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

Definition at line 700 of file date_core.c.

References c_julian_last_day_of_month(), and last.

Referenced by valid_civil_p().

◆ c_valid_ordinal_p()

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

Definition at line 646 of file date_core.c.

References c_find_ldoy(), c_jd_to_ordinal(), c_ordinal_to_jd(), and ComplexDateData::sg.

Referenced by valid_ordinal_p().

◆ c_valid_start_p()

static int c_valid_start_p ( double  sg)
inlinestatic

Definition at line 857 of file date_core.c.

References isinf(), isnan, REFORM_END_JD, and ComplexDateData::sg.

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

◆ c_valid_time_p()

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

◆ c_valid_weeknum_p()

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 785 of file date_core.c.

References c_jd_to_weeknum(), c_weeknum_to_jd(), f, and ComplexDateData::sg.

Referenced by valid_weeknum_p().

◆ c_virtual_sg()

static double c_virtual_sg ( union DateData x)
inlinestatic

◆ c_weeknum_to_jd()

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

Definition at line 584 of file date_core.c.

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

Referenced by c_valid_weeknum_p().

◆ canon()

static VALUE canon ( VALUE  x)
inlinestatic

Definition at line 302 of file date_core.c.

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

◆ canonicalize_c_jd()

static void canonicalize_c_jd ( union DateData x)
inlinestatic

◆ canonicalize_s_jd()

static void canonicalize_s_jd ( union DateData x)
inlinestatic

◆ clear_civil()

static void clear_civil ( union DateData x)
static

◆ cmp_dd()

static VALUE cmp_dd ( VALUE  self,
VALUE  other 
)
static

Definition at line 6199 of file date_core.c.

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

Referenced by d_lite_cmp().

◆ cmp_gen()

static VALUE cmp_gen ( VALUE  self,
VALUE  other 
)
static

Definition at line 6187 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().

◆ d_complex_new_internal()

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

◆ d_lite_ajd()

static VALUE d_lite_ajd ( VALUE  self)
static

Definition at line 4807 of file date_core.c.

References get_d1, and m_ajd().

Referenced by Init_date_core().

◆ d_lite_amjd()

static VALUE d_lite_amjd ( VALUE  self)
static

Definition at line 4824 of file date_core.c.

References get_d1, and m_amjd().

Referenced by Init_date_core().

◆ d_lite_asctime()

static VALUE d_lite_asctime ( VALUE  self)
static

Definition at line 7023 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

◆ d_lite_cmp()

static VALUE d_lite_cmp ( VALUE  self,
VALUE  other 
)
static

◆ d_lite_cwday()

static VALUE d_lite_cwday ( VALUE  self)
static

Definition at line 5000 of file date_core.c.

References get_d1, INT2FIX, and m_cwday().

Referenced by Init_date_core().

◆ d_lite_cweek()

static VALUE d_lite_cweek ( VALUE  self)
static

Definition at line 4985 of file date_core.c.

References get_d1, INT2FIX, and m_cweek().

Referenced by Init_date_core().

◆ d_lite_cwyear()

static VALUE d_lite_cwyear ( VALUE  self)
static

Definition at line 4970 of file date_core.c.

References get_d1, and m_real_cwyear().

Referenced by Init_date_core().

◆ d_lite_day_fraction()

static VALUE d_lite_day_fraction ( VALUE  self)
static

Definition at line 4952 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_downto()

static VALUE d_lite_downto ( VALUE  self,
VALUE  min 
)
static

Definition at line 6172 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_england()

static VALUE d_lite_england ( VALUE  self)
static

Definition at line 5410 of file date_core.c.

References dup_obj_with_new_start(), and ENGLAND.

Referenced by Init_date_core().

◆ d_lite_eql_p()

static VALUE d_lite_eql_p ( VALUE  self,
VALUE  other 
)
static

Definition at line 6489 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_equal()

static VALUE d_lite_equal ( VALUE  self,
VALUE  other 
)
static

◆ d_lite_friday_p()

static VALUE d_lite_friday_p ( VALUE  self)
static

Definition at line 5109 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_gc_mark()

static void d_lite_gc_mark ( union DateData dat)
static

◆ d_lite_gregorian()

static VALUE d_lite_gregorian ( VALUE  self)
static

Definition at line 5434 of file date_core.c.

References dup_obj_with_new_start(), and GREGORIAN.

Referenced by Init_date_core().

◆ d_lite_gregorian_p()

static VALUE d_lite_gregorian_p ( VALUE  self)
static

Definition at line 5267 of file date_core.c.

References f_boolcast, get_d1, and m_gregorian_p().

Referenced by Init_date_core().

◆ d_lite_hash()

static VALUE d_lite_hash ( VALUE  self)
static

Definition at line 6498 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().

◆ d_lite_hour()

static VALUE d_lite_hour ( VALUE  self)
static

Definition at line 5157 of file date_core.c.

References get_d1, INT2FIX, and m_hour().

Referenced by Init_date_core().

◆ d_lite_httpdate()

static VALUE d_lite_httpdate ( VALUE  self)
static

Definition at line 7074 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_initialize_copy()

static VALUE d_lite_initialize_copy ( VALUE  copy,
VALUE  date 
)
static

◆ d_lite_inspect()

static VALUE d_lite_inspect ( VALUE  self)
static

Definition at line 6631 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().

◆ d_lite_iso8601()

static VALUE d_lite_iso8601 ( VALUE  self)
static

Definition at line 7036 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

◆ d_lite_italy()

static VALUE d_lite_italy ( VALUE  self)
static

Definition at line 5398 of file date_core.c.

References dup_obj_with_new_start(), and ITALY.

Referenced by Init_date_core().

◆ d_lite_jd()

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().

◆ d_lite_jisx0301()

static VALUE d_lite_jisx0301 ( VALUE  self)
static

◆ d_lite_julian()

static VALUE d_lite_julian ( VALUE  self)
static

Definition at line 5422 of file date_core.c.

References dup_obj_with_new_start(), and JULIAN.

Referenced by Init_date_core().

◆ d_lite_julian_p()

static VALUE d_lite_julian_p ( VALUE  self)
static

Definition at line 5251 of file date_core.c.

References f_boolcast, get_d1, and m_julian_p().

Referenced by Init_date_core().

◆ d_lite_ld()

static VALUE d_lite_ld ( VALUE  self)
static

Definition at line 4874 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_leap_p()

static VALUE d_lite_leap_p ( VALUE  self)
static

◆ d_lite_lshift()

static VALUE d_lite_lshift ( VALUE  self,
VALUE  other 
)
static

Definition at line 6015 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().

◆ d_lite_marshal_dump()

static VALUE d_lite_marshal_dump ( VALUE  self)
static

◆ d_lite_marshal_load()

static VALUE d_lite_marshal_load ( VALUE  self,
VALUE  a 
)
static

◆ d_lite_mday()

static VALUE d_lite_mday ( VALUE  self)
static

Definition at line 4937 of file date_core.c.

References get_d1, INT2FIX, and m_mday().

Referenced by Init_date_core().

◆ d_lite_min()

static VALUE d_lite_min ( VALUE  self)
static

Definition at line 5173 of file date_core.c.

References get_d1, INT2FIX, and m_min().

Referenced by Init_date_core().

◆ d_lite_minus()

static VALUE d_lite_minus ( VALUE  self,
VALUE  other 
)
static

◆ d_lite_mjd()

static VALUE d_lite_mjd ( VALUE  self)
static

Definition at line 4858 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_mon()

static VALUE d_lite_mon ( VALUE  self)
static

Definition at line 4921 of file date_core.c.

References get_d1, INT2FIX, and m_mon().

Referenced by Init_date_core().

◆ d_lite_monday_p()

static VALUE d_lite_monday_p ( VALUE  self)
static

Definition at line 5057 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_new_offset()

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

Definition at line 5471 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_new_start()

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

Definition at line 5377 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_next()

static VALUE d_lite_next ( VALUE  self)
static

Definition at line 5948 of file date_core.c.

References d_lite_next_day(), and NULL.

Referenced by Init_date_core().

◆ d_lite_next_day()

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

Definition at line 5914 of file date_core.c.

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

Referenced by d_lite_next(), and Init_date_core().

◆ d_lite_next_month()

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

Definition at line 6027 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_next_year()

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

Definition at line 6061 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_offset()

static VALUE d_lite_offset ( VALUE  self)
static

Definition at line 5220 of file date_core.c.

References get_d1, and m_of_in_day().

Referenced by Init_date_core().

◆ d_lite_plus()

static VALUE d_lite_plus ( VALUE  self,
VALUE  other 
)
static

◆ d_lite_prev_day()

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

Definition at line 5931 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_prev_month()

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

Definition at line 6044 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_prev_year()

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

Definition at line 6078 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_rfc2822()

static VALUE d_lite_rfc2822 ( VALUE  self)
static

Definition at line 7061 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

◆ d_lite_rfc3339()

static VALUE d_lite_rfc3339 ( VALUE  self)
static

Definition at line 7048 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

◆ d_lite_rshift()

static VALUE d_lite_rshift ( VALUE  self,
VALUE  other 
)
static

◆ d_lite_s_alloc()

static VALUE d_lite_s_alloc ( VALUE  klass)
static

Definition at line 3021 of file date_core.c.

References d_lite_s_alloc_complex().

Referenced by date_s__load(), and Init_date_core().

◆ d_lite_s_alloc_complex()

static VALUE d_lite_s_alloc_complex ( VALUE  klass)
static

◆ d_lite_s_alloc_simple()

static VALUE d_lite_s_alloc_simple ( VALUE  klass)
static

Definition at line 2999 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().

◆ d_lite_saturday_p()

static VALUE d_lite_saturday_p ( VALUE  self)
static

Definition at line 5122 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_sec()

static VALUE d_lite_sec ( VALUE  self)
static

Definition at line 5189 of file date_core.c.

References get_d1, INT2FIX, and m_sec().

Referenced by Init_date_core().

◆ d_lite_sec_fraction()

static VALUE d_lite_sec_fraction ( VALUE  self)
static

Definition at line 5205 of file date_core.c.

References get_d1, and m_sf_in_sec().

Referenced by Init_date_core().

◆ d_lite_start()

static VALUE d_lite_start ( VALUE  self)
static

Definition at line 5307 of file date_core.c.

References DBL2NUM, get_d1, and m_sg().

Referenced by Init_date_core().

◆ d_lite_step()

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

◆ d_lite_strftime()

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

Definition at line 6990 of file date_core.c.

References argc, argv, date_strftime_internal(), and set_tmx().

Referenced by Init_date_core().

◆ d_lite_sunday_p()

static VALUE d_lite_sunday_p ( VALUE  self)
static

Definition at line 5044 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_thursday_p()

static VALUE d_lite_thursday_p ( VALUE  self)
static

Definition at line 5096 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_to_s()

static VALUE d_lite_to_s ( VALUE  self)
static

Definition at line 6526 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

◆ d_lite_tuesday_p()

static VALUE d_lite_tuesday_p ( VALUE  self)
static

Definition at line 5070 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_upto()

static VALUE d_lite_upto ( VALUE  self,
VALUE  max 
)
static

Definition at line 6150 of file date_core.c.

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

Referenced by Init_date_core().

◆ d_lite_wday()

static VALUE d_lite_wday ( VALUE  self)
static

Definition at line 5031 of file date_core.c.

References get_d1, INT2FIX, and m_wday().

Referenced by Init_date_core(), and rt_complete_frags().

◆ d_lite_wednesday_p()

static VALUE d_lite_wednesday_p ( VALUE  self)
static

Definition at line 5083 of file date_core.c.

References f_boolcast, get_d1, and m_wday().

Referenced by Init_date_core().

◆ d_lite_yday()

static VALUE d_lite_yday ( VALUE  self)
static

Definition at line 4905 of file date_core.c.

References get_d1, INT2FIX, and m_yday().

Referenced by Init_date_core().

◆ d_lite_year()

static VALUE d_lite_year ( VALUE  self)
static

Definition at line 4890 of file date_core.c.

References get_d1, and m_real_year().

Referenced by Init_date_core(), and rt_complete_frags().

◆ d_lite_zone()

static VALUE d_lite_zone ( VALUE  self)
static

Definition at line 5235 of file date_core.c.

References get_d1, and m_zone().

Referenced by Init_date_core().

◆ d_new_by_frags()

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

◆ d_simple_new_internal()

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

◆ d_trunc()

static VALUE d_trunc ( VALUE  d,
VALUE fr 
)
inlinestatic

Definition at line 3137 of file date_core.c.

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

◆ date__httpdate()

VALUE date__httpdate ( VALUE  )

Referenced by date_s__httpdate().

◆ date__iso8601()

VALUE date__iso8601 ( VALUE  )

Referenced by date_s__iso8601().

◆ date__jisx0301()

VALUE date__jisx0301 ( VALUE  )

Referenced by date_s__jisx0301().

◆ date__parse()

VALUE date__parse ( VALUE  str,
VALUE  comp 
)

Referenced by date_s__parse_internal().

◆ date__rfc2822()

VALUE date__rfc2822 ( VALUE  )

Referenced by date_s__rfc2822().

◆ date__rfc3339()

VALUE date__rfc3339 ( VALUE  )

Referenced by date_s__rfc3339().

◆ date__strptime()

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

◆ date__xmlschema()

VALUE date__xmlschema ( VALUE  )

Referenced by date_s__xmlschema().

◆ date_s__httpdate()

static VALUE date_s__httpdate ( VALUE  klass,
VALUE  str 
)
static

Definition at line 4558 of file date_core.c.

References date__httpdate().

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

◆ date_s__iso8601()

static VALUE date_s__iso8601 ( VALUE  klass,
VALUE  str 
)
static

Definition at line 4389 of file date_core.c.

References date__iso8601().

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

◆ date_s__jisx0301()

static VALUE date_s__jisx0301 ( VALUE  klass,
VALUE  str 
)
static

Definition at line 4600 of file date_core.c.

References date__jisx0301().

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

◆ date_s__load()

static VALUE date_s__load ( VALUE  klass,
VALUE  s 
)
static

Definition at line 7261 of file date_core.c.

References d_lite_marshal_load(), d_lite_s_alloc(), and rb_marshal_load().

Referenced by Init_date_core().

◆ date_s__parse()

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

Definition at line 4329 of file date_core.c.

References argc, argv, and date_s__parse_internal().

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

◆ date_s__parse_internal()

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

◆ date_s__rfc2822()

static VALUE date_s__rfc2822 ( VALUE  klass,
VALUE  str 
)
static

Definition at line 4515 of file date_core.c.

References date__rfc2822().

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

◆ date_s__rfc3339()

static VALUE date_s__rfc3339 ( VALUE  klass,
VALUE  str 
)
static

Definition at line 4432 of file date_core.c.

References date__rfc3339().

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

◆ date_s__strptime()

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

Definition at line 4235 of file date_core.c.

References argc, argv, and date_s__strptime_internal().

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

◆ date_s__strptime_internal()

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

◆ date_s__xmlschema()

static VALUE date_s__xmlschema ( VALUE  klass,
VALUE  str 
)
static

Definition at line 4473 of file date_core.c.

References date__xmlschema().

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

◆ date_s_civil()

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

◆ date_s_commercial()

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

◆ date_s_gregorian_leap_p()

static VALUE date_s_gregorian_leap_p ( VALUE  klass,
VALUE  y 
)
static

Definition at line 2935 of file date_core.c.

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

Referenced by Init_date_core().

◆ date_s_httpdate()

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

◆ date_s_iso8601()

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

◆ date_s_jd()

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

◆ date_s_jisx0301()

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

◆ date_s_julian_leap_p()

static VALUE date_s_julian_leap_p ( VALUE  klass,
VALUE  y 
)
static

Definition at line 2914 of file date_core.c.

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

Referenced by Init_date_core().

◆ date_s_ordinal()

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

◆ date_s_parse()

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

◆ date_s_rfc2822()

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

◆ date_s_rfc3339()

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

◆ date_s_strptime()

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

◆ date_s_today()

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

◆ date_s_valid_civil_p()

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

Definition at line 2568 of file date_core.c.

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

Referenced by Init_date_core().

◆ date_s_valid_commercial_p()

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

Definition at line 2731 of file date_core.c.

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

Referenced by Init_date_core().

◆ date_s_valid_jd_p()

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

Definition at line 2479 of file date_core.c.

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

Referenced by Init_date_core().

◆ date_s_valid_ordinal_p()

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

Definition at line 2649 of file date_core.c.

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

Referenced by Init_date_core().

◆ date_s_xmlschema()

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

◆ date_strftime()

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

Definition at line 623 of file date_strftime.c.

References date_strftime_with_tmx().

Referenced by date_strftime_alloc().

◆ date_strftime_alloc()

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

Definition at line 6650 of file date_core.c.

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

Referenced by date_strftime_internal(), and strftimev().

◆ date_strftime_internal()

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

◆ date_to_date()

static VALUE date_to_date ( VALUE  self)
static

Definition at line 8636 of file date_core.c.

Referenced by Init_date_core().

◆ date_to_datetime()

static VALUE date_to_datetime ( VALUE  self)
static

◆ date_to_time()

static VALUE date_to_time ( VALUE  self)
static

Definition at line 8619 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().

◆ date_zone_to_diff()

VALUE date_zone_to_diff ( VALUE  )

Definition at line 420 of file date_parse.c.

Referenced by offset_to_sec().

◆ datetime_s__strptime()

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

Definition at line 7941 of file date_core.c.

References argc, argv, and date_s__strptime_internal().

Referenced by Init_date_core().

◆ datetime_s_civil()

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

◆ datetime_s_commercial()

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

◆ datetime_s_httpdate()

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

◆ datetime_s_iso8601()

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

◆ datetime_s_jd()

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

◆ datetime_s_jisx0301()

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

◆ datetime_s_now()

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

◆ datetime_s_ordinal()

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

◆ datetime_s_parse()

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

◆ datetime_s_rfc2822()

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

◆ datetime_s_rfc3339()

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

◆ datetime_s_strptime()

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

◆ datetime_s_xmlschema()

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

◆ datetime_to_date()

static VALUE datetime_to_date ( VALUE  self)
static

◆ datetime_to_datetime()

static VALUE datetime_to_datetime ( VALUE  self)
static

Definition at line 8747 of file date_core.c.

Referenced by Init_date_core().

◆ datetime_to_time()

static VALUE datetime_to_time ( VALUE  self)
static

◆ day_to_sec()

static VALUE day_to_sec ( VALUE  d)
static

Definition at line 995 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().

◆ decode_day()

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

Definition at line 1065 of file date_core.c.

References ComplexDateData::df, div_day(), div_df(), f, ComplexDateData::jd, sec_to_ns(), and ComplexDateData::sf.

Referenced by old_to_new().

◆ decode_jd()

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

◆ decode_year()

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

◆ df_local_to_utc()

static int df_local_to_utc ( int  df,
int  of 
)
inlinestatic

Definition at line 869 of file date_core.c.

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

Referenced by dt_new_by_frags(), and get_c_df().

◆ df_to_time()

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

Definition at line 919 of file date_core.c.

References ComplexDateData::df, HOUR_IN_SECONDS, and MINUTE_IN_SECONDS.

Referenced by get_c_time().

◆ df_utc_to_local()

static int df_utc_to_local ( int  df,
int  of 
)
inlinestatic

Definition at line 880 of file date_core.c.

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

Referenced by get_c_time(), and local_df().

◆ div_day()

static VALUE div_day ( VALUE  d,
VALUE f 
)
static

Definition at line 1035 of file date_core.c.

References f, f_floor, f_mod, and INT2FIX.

Referenced by decode_day().

◆ div_df()

static VALUE div_df ( VALUE  d,
VALUE f 
)
static

Definition at line 1043 of file date_core.c.

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

Referenced by decode_day().

◆ dt_lite_iso8601()

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

Definition at line 8462 of file date_core.c.

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

Referenced by dt_lite_rfc3339(), and Init_date_core().

◆ dt_lite_jisx0301()

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

◆ dt_lite_rfc3339()

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

Definition at line 8486 of file date_core.c.

References argc, argv, and dt_lite_iso8601().

Referenced by Init_date_core().

◆ dt_lite_strftime()

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

Definition at line 8421 of file date_core.c.

References argc, argv, date_strftime_internal(), and set_tmx().

Referenced by Init_date_core().

◆ dt_lite_to_s()

static VALUE dt_lite_to_s ( VALUE  self)
static

Definition at line 8238 of file date_core.c.

References set_tmx(), and strftimev().

Referenced by Init_date_core().

◆ dt_new_by_frags()

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

◆ dup_obj()

static VALUE dup_obj ( VALUE  self)
static

◆ dup_obj_as_complex()

static VALUE dup_obj_as_complex ( VALUE  self)
static

◆ dup_obj_with_new_offset()

static VALUE dup_obj_with_new_offset ( VALUE  obj,
int  of 
)
static

Definition at line 5450 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().

◆ dup_obj_with_new_start()

static VALUE dup_obj_with_new_start ( VALUE  obj,
double  sg 
)
static

Definition at line 5357 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().

◆ encode_jd()

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

◆ encode_year()

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

Definition at line 1334 of file date_core.c.

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

Referenced by m_real_cwyear(), and m_real_year().

◆ equal_gen()

static VALUE equal_gen ( VALUE  self,
VALUE  other 
)
static

Definition at line 6387 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().

◆ f_cmp()

static VALUE f_cmp ( VALUE  x,
VALUE  y 
)
inlinestatic

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().

◆ f_eqeq_p()

static VALUE f_eqeq_p ( VALUE  x,
VALUE  y 
)
inlinestatic

◆ f_ge_p()

static VALUE f_ge_p ( VALUE  x,
VALUE  y 
)
inlinestatic

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().

◆ f_gt_p()

static VALUE f_gt_p ( VALUE  x,
VALUE  y 
)
inlinestatic

Definition at line 73 of file date_core.c.

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

Referenced by iso8601_timediv(), and rt_complete_frags().

◆ f_kind_of_p()

static VALUE f_kind_of_p ( VALUE  x,
VALUE  c 
)
inlinestatic

Definition at line 1968 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().

◆ f_le_p()

static VALUE f_le_p ( VALUE  x,
VALUE  y 
)
inlinestatic

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().

◆ f_lt_p()

static VALUE f_lt_p ( VALUE  x,
VALUE  y 
)
inlinestatic

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().

◆ f_negative_p()

static VALUE f_negative_p ( VALUE  x)
inlinestatic

◆ f_zero_p()

static VALUE f_zero_p ( VALUE  x)
inlinestatic

◆ get_c_civil()

static void get_c_civil ( union DateData x)
inlinestatic

◆ get_c_df()

static void get_c_df ( union DateData x)
inlinestatic

◆ get_c_jd()

static void get_c_jd ( union DateData x)
inlinestatic

◆ get_c_time()

static void get_c_time ( union DateData x)
inlinestatic

◆ get_s_civil()

static void get_s_civil ( union DateData x)
inlinestatic

◆ get_s_jd()

static void get_s_jd ( union DateData x)
inlinestatic

◆ gmtime_r()

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

Definition at line 3607 of file date_core.c.

Referenced by datetime_s_now().

◆ guess_style()

static double guess_style ( VALUE  y,
double  sg 
)
inlinestatic

◆ h_trunc()

static VALUE h_trunc ( VALUE  h,
VALUE fr 
)
inlinestatic

Definition at line 3156 of file date_core.c.

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

◆ Init_date_core()

void Init_date_core ( void  )

Definition at line 9098 of file date_core.c.

References abbr_daynames, abbr_monthnames, 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__load(), 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, daynames, 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(), monthnames, 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().

◆ isec_to_day()

static VALUE isec_to_day ( int  s)
inlinestatic

Definition at line 936 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().

◆ iso8601_timediv()

static VALUE iso8601_timediv ( VALUE  self,
VALUE  n 
)
static

◆ jd_local_to_utc()

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

◆ jd_utc_to_local()

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

Definition at line 902 of file date_core.c.

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

Referenced by get_c_civil(), and local_jd().

◆ jisx0301_date()

static VALUE jisx0301_date ( VALUE  jd,
VALUE  y 
)
static

Definition at line 7081 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().

◆ k_date_p()

static VALUE k_date_p ( VALUE  x)
inlinestatic

Definition at line 1974 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().

◆ k_datetime_p()

static VALUE k_datetime_p ( VALUE  x)
inlinestatic

Definition at line 1980 of file date_core.c.

References cDateTime, and f_kind_of_p().

◆ k_numeric_p()

static VALUE k_numeric_p ( VALUE  x)
inlinestatic

◆ k_rational_p()

static VALUE k_rational_p ( VALUE  x)
inlinestatic

Definition at line 1992 of file date_core.c.

References f_kind_of_p(), and rb_cRational.

Referenced by d_lite_plus(), and offset_to_sec().

◆ local_df()

static int local_df ( union DateData x)
inlinestatic

◆ local_jd()

static int local_jd ( union DateData x)
inlinestatic

◆ localtime_r()

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

Definition at line 3616 of file date_core.c.

Referenced by date_s_today(), and datetime_s_now().

◆ m_ajd()

static VALUE m_ajd ( union DateData x)
static

◆ m_amjd()

static VALUE m_amjd ( union DateData x)
static

◆ m_canonicalize_jd()

static void m_canonicalize_jd ( union DateData x)
inlinestatic

Definition at line 1397 of file date_core.c.

References canonicalize_c_jd(), canonicalize_s_jd(), get_c_jd(), get_s_jd(), and simple_dat_p.

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

◆ m_cwday()

static int m_cwday ( union DateData x)
static

Definition at line 1864 of file date_core.c.

References m_wday().

Referenced by d_lite_cwday().

◆ m_cweek()

static int m_cweek ( union DateData x)
static

Definition at line 1854 of file date_core.c.

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

Referenced by d_lite_cweek().

◆ m_cwyear()

static int m_cwyear ( union DateData x)
static

Definition at line 1826 of file date_core.c.

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

Referenced by m_real_cwyear().

◆ m_df()

static int m_df ( union DateData x)
inlinestatic

◆ m_fr()

static VALUE m_fr ( union DateData x)
static

◆ m_gregorian_p()

static int m_gregorian_p ( union DateData x)
inlinestatic

◆ m_hour()

static int m_hour ( union DateData x)
inlinestatic

Definition at line 1897 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().

◆ m_jd()

static int m_jd ( union DateData x)
inlinestatic

◆ m_julian_p()

static int m_julian_p ( union DateData x)
static

◆ m_local_df()

static int m_local_df ( union DateData x)
static

Definition at line 1493 of file date_core.c.

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

Referenced by m_fr().

◆ m_local_jd()

static int m_local_jd ( union DateData x)
static

◆ m_mday()

static int m_mday ( union DateData x)
inlinestatic

◆ m_min()

static int m_min ( union DateData x)
inlinestatic

Definition at line 1912 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().

◆ m_mon()

static int m_mon ( union DateData x)
inlinestatic

◆ m_nth()

static VALUE m_nth ( union DateData x)
inlinestatic

◆ m_of()

static int m_of ( union DateData x)
inlinestatic

◆ m_of_in_day()

static VALUE m_of_in_day ( union DateData x)
static

Definition at line 1627 of file date_core.c.

References isec_to_day(), and m_of().

Referenced by d_lite_offset().

◆ m_pc()

static int m_pc ( union DateData x)
inlinestatic

◆ m_proleptic_gregorian_p()

static int m_proleptic_gregorian_p ( union DateData x)
inlinestatic

Definition at line 1682 of file date_core.c.

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

Referenced by m_yday().

◆ m_proleptic_julian_p()

static int m_proleptic_julian_p ( union DateData x)
inlinestatic

Definition at line 1671 of file date_core.c.

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

Referenced by m_yday().

◆ m_real_cwyear()

static VALUE m_real_cwyear ( union DateData x)
static

◆ m_real_jd()

static VALUE m_real_jd ( union DateData x)
static

Definition at line 1434 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().

◆ m_real_local_jd()

static VALUE m_real_local_jd ( union DateData x)
static

◆ m_real_year()

static VALUE m_real_year ( union DateData x)
static

◆ m_sec()

static int m_sec ( union DateData x)
inlinestatic

Definition at line 1927 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().

◆ m_sf()

static VALUE m_sf ( union DateData x)
inlinestatic

◆ m_sf_in_sec()

static VALUE m_sf_in_sec ( union DateData x)
static

Definition at line 1529 of file date_core.c.

References m_sf(), and ns_to_sec().

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

◆ m_sg()

static double m_sg ( union DateData x)
inlinestatic

◆ m_virtual_sg()

static double m_virtual_sg ( union DateData x)
inlinestatic

Definition at line 1099 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().

◆ m_wday()

static int m_wday ( union DateData x)
static

◆ m_wnum0()

static int m_wnum0 ( union DateData x)
static

Definition at line 1885 of file date_core.c.

References m_wnumx().

◆ m_wnum1()

static int m_wnum1 ( union DateData x)
static

Definition at line 1891 of file date_core.c.

References m_wnumx().

◆ m_wnumx()

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

Definition at line 1875 of file date_core.c.

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

Referenced by m_wnum0(), and m_wnum1().

◆ m_yday()

static int m_yday ( union DateData x)
static

◆ m_year()

static int m_year ( union DateData x)
inlinestatic

◆ m_zone()

static VALUE m_zone ( union DateData x)
static

Definition at line 1960 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().

◆ min_trunc()

static VALUE min_trunc ( VALUE  min,
VALUE fr 
)
inlinestatic

Definition at line 3173 of file date_core.c.

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

◆ minus_dd()

static VALUE minus_dd ( VALUE  self,
VALUE  other 
)
static

◆ mk_ary_of_str()

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

Definition at line 9076 of file date_core.c.

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

Referenced by Init_date_core().

◆ mk_inspect()

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

◆ ns_to_day()

static VALUE ns_to_day ( VALUE  n)
static

Definition at line 942 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().

◆ ns_to_sec()

static VALUE ns_to_sec ( VALUE  n)
static

Definition at line 960 of file date_core.c.

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

Referenced by m_sf_in_sec().

◆ of2str()

static VALUE of2str ( int  of)
static

Definition at line 1951 of file date_core.c.

References decode_offset, ComplexDateData::of, rb_enc_sprintf(), and rb_usascii_encoding().

Referenced by m_zone().

◆ offset_to_sec()

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

◆ old_to_new()

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

◆ rt__valid_civil_p()

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

Definition at line 3984 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().

◆ rt__valid_commercial_p()

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

Definition at line 3999 of file date_core.c.

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

Referenced by rt__valid_date_frags_p().

◆ rt__valid_date_frags_p()

static VALUE rt__valid_date_frags_p ( VALUE  hash,
VALUE  sg 
)
static

◆ rt__valid_jd_p()

static VALUE rt__valid_jd_p ( VALUE  jd,
VALUE  sg 
)
static

Definition at line 3963 of file date_core.c.

Referenced by rt__valid_date_frags_p().

◆ rt__valid_ordinal_p()

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

Definition at line 3969 of file date_core.c.

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

Referenced by rt__valid_date_frags_p().

◆ rt__valid_weeknum_p()

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

Definition at line 4014 of file date_core.c.

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

Referenced by rt__valid_date_frags_p().

◆ rt_complete_frags()

static VALUE rt_complete_frags ( VALUE  klass,
VALUE  hash 
)
static

◆ rt_rewrite_frags()

static VALUE rt_rewrite_frags ( VALUE  hash)
static

◆ s_trunc()

static VALUE s_trunc ( VALUE  s,
VALUE fr 
)
inlinestatic

Definition at line 3190 of file date_core.c.

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

◆ s_virtual_sg()

static double s_virtual_sg ( union DateData x)
inlinestatic

◆ safe_mul_p()

static int safe_mul_p ( VALUE  x,
long  m 
)
static

Definition at line 976 of file date_core.c.

References FIX2LONG, FIXNUM_MAX, FIXNUM_MIN, and FIXNUM_P.

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

◆ sec_to_day()

static VALUE sec_to_day ( VALUE  s)
static

Definition at line 928 of file date_core.c.

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

Referenced by isec_to_day().

◆ sec_to_ms()

static VALUE sec_to_ms ( VALUE  s)
static

Definition at line 1011 of file date_core.c.

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

Referenced by tmx_m_msecs().

◆ sec_to_ns()

static VALUE sec_to_ns ( VALUE  s)
static

Definition at line 1019 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().

◆ set_of()

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

◆ set_sg()

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

◆ set_tmx()

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

◆ strftimev()

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

◆ time_to_date()

static VALUE time_to_date ( VALUE  self)
static

◆ time_to_datetime()

static VALUE time_to_datetime ( VALUE  self)
static

◆ time_to_df()

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

◆ time_to_time()

static VALUE time_to_time ( VALUE  self)
static

Definition at line 8536 of file date_core.c.

References f_getlocal.

Referenced by Init_date_core().

◆ tmx_m_msecs()

static VALUE tmx_m_msecs ( union DateData x)
static

◆ tmx_m_of()

static int tmx_m_of ( union DateData x)
static

Definition at line 6717 of file date_core.c.

References m_of().

◆ tmx_m_secs()

static VALUE tmx_m_secs ( union DateData x)
static

Definition at line 6685 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().

◆ tmx_m_zone()

static char* tmx_m_zone ( union DateData x)
static

Definition at line 6723 of file date_core.c.

References m_zone(), and RSTRING_PTR.

◆ to_integer()

static VALUE to_integer ( VALUE  x)
inlinestatic

Definition at line 3129 of file date_core.c.

References f_to_i, FIXNUM_P, RB_TYPE_P, and T_BIGNUM.

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

◆ valid_civil_p()

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

◆ valid_civil_sub()

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

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

◆ valid_commercial_sub()

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

◆ valid_gregorian_p()

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

◆ valid_jd_sub()

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

Definition at line 2442 of file date_core.c.

References argv, NUM2DBL, ComplexDateData::sg, and valid_sg.

Referenced by date_s_valid_jd_p().

◆ valid_ordinal_p()

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

◆ valid_ordinal_sub()

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

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

◆ wholenum_p()

static int wholenum_p ( VALUE  x)
inlinestatic

Variable Documentation

◆ abbr_daynames

const char* abbr_daynames[]
static
Initial value:
= {
"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat"
}

Definition at line 9070 of file date_core.c.

Referenced by Init_date_core().

◆ abbr_monthnames

const char* abbr_monthnames[]
static
Initial value:
= {
"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"
}
#define NULL
Definition: _sdbm.c:102

Definition at line 9058 of file date_core.c.

Referenced by Init_date_core().

◆ cDate

VALUE cDate
static

◆ cDateTime

VALUE cDateTime
static

◆ day_in_nanoseconds

VALUE day_in_nanoseconds
static

Definition at line 21 of file date_core.c.

Referenced by Init_date_core(), and ns_to_day().

◆ daynames

const char* daynames[]
static
Initial value:
= {
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
}

Definition at line 9065 of file date_core.c.

Referenced by Init_date_core().

◆ half_days_in_day

VALUE half_days_in_day
static

Definition at line 21 of file date_core.c.

Referenced by d_lite_marshal_load(), Init_date_core(), and old_to_new().

◆ id_cmp

ID id_cmp
static

Definition at line 19 of file date_core.c.

Referenced by f_cmp(), and Init_date_core().

◆ id_eqeq_p

ID id_eqeq_p
static

Definition at line 19 of file date_core.c.

Referenced by f_zero_p(), and Init_date_core().

◆ id_ge_p

ID id_ge_p
static

Definition at line 19 of file date_core.c.

Referenced by Init_date_core().

◆ id_le_p

ID id_le_p
static

Definition at line 19 of file date_core.c.

Referenced by f_le_p(), and Init_date_core().

◆ monthnames

const char* monthnames[]
static
Initial value:
= {
"January", "February", "March",
"April", "May", "June",
"July", "August", "September",
"October", "November", "December"
}
#define NULL
Definition: _sdbm.c:102

Definition at line 9050 of file date_core.c.

Referenced by Init_date_core().

◆ monthtab

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 668 of file date_core.c.

Referenced by c_gregorian_last_day_of_month(), and c_julian_last_day_of_month().

◆ negative_inf

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().

◆ positive_inf

double positive_inf
static

◆ tmx_funcs

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,
(int (*)(void *))tmx_m_of,
(char *(*)(void *))tmx_m_zone
}
static VALUE tmx_m_secs(union DateData *x)
Definition: date_core.c:6685
static int m_min(union DateData *x)
Definition: date_core.c:1912
static int m_wnum1(union DateData *x)
Definition: date_core.c:1891
static int m_hour(union DateData *x)
Definition: date_core.c:1897
static int tmx_m_of(union DateData *x)
Definition: date_core.c:6717
static int m_mon(union DateData *x)
Definition: date_core.c:1741
static VALUE m_sf_in_sec(union DateData *x)
Definition: date_core.c:1529
static int m_yday(union DateData *x)
Definition: date_core.c:1802
static VALUE m_real_cwyear(union DateData *x)
Definition: date_core.c:1836
unsigned long VALUE
Definition: ruby.h:104
static VALUE tmx_m_msecs(union DateData *x)
Definition: date_core.c:6703
static int m_mday(union DateData *x)
Definition: date_core.c:1762
static int m_wday(union DateData *x)
Definition: date_core.c:1820
static int m_cwday(union DateData *x)
Definition: date_core.c:1864
static int m_wnum0(union DateData *x)
Definition: date_core.c:1885
static int m_sec(union DateData *x)
Definition: date_core.c:1927
static int m_cweek(union DateData *x)
Definition: date_core.c:1854
static char * tmx_m_zone(union DateData *x)
Definition: date_core.c:6723
static VALUE m_real_year(union DateData *x)
Definition: date_core.c:1706

Definition at line 6728 of file date_core.c.

Referenced by set_tmx().

◆ yeartab

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 1782 of file date_core.c.

Referenced by c_gregorian_to_yday(), and c_julian_to_yday().