pike.git / lib / modules / Calendar.pmod / YMD.pike

version» Context lines:

pike.git/lib/modules/Calendar.pmod/YMD.pike:3:   //! submodule YMD   //!   //! base for all Roman-kind of Calendars,   //! ie, one with years, months, weeks and days   //!      #pike __REAL_VERSION__      // #pragma strict_types    - inherit .Time:Time; + inherit Calendar.Time:Time;      #include "constants.h"      // ----------------   // virtual methods to tell how this calendar works   // ----------------      static array(int) year_from_julian_day(int jd);   static int julian_day_from_year(int year);   static int year_remaining_days(int y,int yday);
pike.git/lib/modules/Calendar.pmod/YMD.pike:68:    int wy; // [*] week year    int w; // [*] week of week year (1..)    int wd; // [*] day of week (1..7?)       int mnd=CALUNKNOWN; // [*] days in current month    int utco=CALUNKNOWN; // [*] distance to UTC    string tzn=0; // timezone name       // [*]: might be uninitialized (CALUNKNOWN)    -  .Ruleset rules; +  Calendar.Ruleset rules;    constant is_ymd=1;      // ----------------------------------------   // basic Y-M-D stuff   // ----------------------------------------       void create_now()    {    rules=default_rules;    create_unixtime_default(time());
pike.git/lib/modules/Calendar.pmod/YMD.pike:1384:    sscanf(mp[0],"w%d",num);       cWeek w=::week(num);    if (w->week_no()==num) return w;    return ::week(num-(w->week_no()-num));    }    else    return ::week(@mp);    }    -  cYear set_ruleset(.Ruleset r) +  cYear set_ruleset(Calendar.Ruleset r)    {    return Year("ymd_y",r,y,yjd,n);    }   }         // ----------------------------------------------------------------   // Month   // ----------------------------------------------------------------   
pike.git/lib/modules/Calendar.pmod/YMD.pike:1648:    Week("julian_r",jd,rules)    ->range(Week("julian_r",julian_day_from_year(y2)+yd2-2,rules))    ->number_of_weeks();    }       int number_of_months()    {    return n;    }    -  cMonth set_ruleset(.Ruleset r) +  cMonth set_ruleset(Calendar.Ruleset r)    {    return Month("ymd_yjmw",r,y,yjd,jd,m,n,wd,w,wy);    }      // --- needs to be defined       static int months_to_month(int y,int m);   }      // ----------------------------------------------------------------
pike.git/lib/modules/Calendar.pmod/YMD.pike:1988:    rules->language[f_week_day_number_from_name](mp[0]);    if (!num)    error("no such day %O in %O\n",mp[0],this);       return ::day(num);    }    else    return ::day(@mp);    }    -  cWeek set_ruleset(.Ruleset r) +  cWeek set_ruleset(Calendar.Ruleset r)    {    return Week("ymd_yjwm",r,y,yjd,jd,w,n,md,m,mnd);    }      // --- needs to be defined       static int weeks_to_week(int y,int m);   }      // ----------------------------------------------------------------
pike.git/lib/modules/Calendar.pmod/YMD.pike:2348:    if (nw!=CALUNKNOWN) return nw;       if (n<=1) return nw=1;       return nw=    Week("julian_r",jd,rules)    ->range(Week("julian_r",jd+n-1,rules))    ->number_of_weeks();    }    -  cDay set_ruleset(.Ruleset r) +  cDay set_ruleset(Calendar.Ruleset r)    {    return Day("ymd_ydmw",r,y,yjd,jd,yd,n,m,md,wy,w,wd,mnd);    }      // backwards compatible with calendar I    string iso_name() { return format_ymd(); }    string iso_short_name() { return format_ymd_short(); }   }      function(mixed...:cDay) Day=cDay;
pike.git/lib/modules/Calendar.pmod/YMD.pike:2635:    sscanf(zonename,"%*[ \t]%s",zonename);       if(sizeof(zonename)==4 && zonename[2]=='S')    zonename = zonename[0..1] + zonename[3..3];    else if(sizeof(zonename)>4 && has_suffix(zonename, "DST"))    zonename = zonename[..<3];       if (origin->rules->abbr2zone[zonename])    zonename=origin->rules->abbr2zone[zonename];    -  .Rule.Timezone zone=.Timezone[zonename]; +  Calendar.Rule.Timezone zone=Calendar.Timezone[zonename];    if (!zone)    {    if (sscanf(zonename,"%[^-+]%s",string a,string b)==2 && a!="" && b!="")    {    TimeRange tr=dwim_zone(origin,a,whut,@args);    if (!tr) return 0;       return    dwim_tod(origin->set_timezone( -  .Timezone.make_new_timezone( +  Calendar.Timezone.make_new_timezone(    tr->timezone(), -  .Timezone.decode_timeskew(b))), +  Calendar.Timezone.decode_timeskew(b))),    whut,@args);    }    if(!abbr2zones)    abbr2zones = master()->resolv("Calendar")["TZnames"]["abbr2zones"];    array pz=abbr2zones[zonename];    if (!pz) return 0;    foreach (pz,string zn)    {    TimeRange try=dwim_zone(origin,zn,whut,@args);    if (try && try->tzname()==zonename) return try;
pike.git/lib/modules/Calendar.pmod/YMD.pike:2722:    mapping m=mkmapping(q,res);    if (i!=-1 && m->n!="") return 0;      // werror("%O\n",m);      // werror("bopa %O\n %O\n %O\n %O\n",fmt,arg,nfmt,m);          TimeRange low;    -  .Calendar cal=this; +  Calendar.Calendar cal=this;         // #define NOCATCH   #ifndef NOCATCH    if (catch {   #else    werror("%O\n",m);   #endif    if (m->n && m->n!="") return 0;