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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/mkrules.pike:3:   // ftp://elsie.nci.nih.gov/pub/   // (timezone mailing list: tz@elsie.nci.nih.gov)   //   // source datafile are usually found somewhere around zic(8),   // if they exist in the system.   //   // Most systems only have compiled files, just like pike,   // and zic(8) is the usual compiler.      // pike mkrules.pike ../data/{africa,antarctica,asia,australasia,backward,etcetera,europe,northamerica,pacificnew,southamerica,systemv} - // $Id: mkrules.pike,v 1.9 2003/08/07 14:20:19 nilsson Exp $ + // $Id: mkrules.pike,v 1.10 2004/01/11 00:51:23 nilsson Exp $      #pike __REAL_VERSION__      object cal=Calendar.ISO->set_timezone("UTC");   function Year=cal->Year;   object nleapy=Year(1999);      object tzrules; // needed to make timezones, compiled below      mapping rules=([]);
pike.git/lib/modules/Calendar.pmod/mkrules.pike:182:       return "LDAYL("+(nleapy->month(mon)->day(d)->year_day())+    ","+wd+")";    }    else    complain("unknown rule method %O\n",rule);    }       Shift|array ``+(array|Shift s)    { -  if (!s) return this_object(); +  if (!s) return this;    if (!arrayp(s)) s=({s}); -  return s+({this_object()}); +  return s+({this});    }       int ldayl_is_fix_l(int d1,int wd,int d2,int yn1,int yn2)    {    object y1=Year(yn1);    object y2=Year(yn2);    int yjd,leap;       yjd=y1->julian_day();    leap=y1->leap_year();
pike.git/lib/modules/Calendar.pmod/mkrules.pike:208:    leap=y2->leap_year();    d2=FIX_L(d2);       return d1==d2;    }       Shift try_promote(Shift t,int y0,int y1)    {   // this is year y0   // t is year y1 -  if (t==this_object()) return t; // same! +  if (t==this) return t; // same!    if (t->time!=time ||    t->timetype!=timetype ||    t->offset!=offset ||    t->s!=s) return 0; // no chance       int a,b,c;    if (sscanf(dayrule,"LDAYL(%d,%d)",a,b)==2 &&    sscanf(t->dayrule,"FIX_L(%d)",c)==1)    if (ldayl_is_fix_l(a,b,c,y0,y1)) -  return this_object(); // ldayl +  return this; // ldayl    else    return 0; // no    if (sscanf(t->dayrule,"LDAYL(%d,%d)",a,b)==2 &&    sscanf(dayrule,"FIX_L(%d)",c)==1)    if (ldayl_is_fix_l(a,b,c,y1,y0))    return t; // ldayl    else    return 0; // no       return 0;