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.12 2008/05/18 13:15:17 grubba Exp $ + // $Id: mkrules.pike,v 1.13 2008/06/28 19:59:36 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:325:       if (!r2[NUL_YEAR]) r2[NUL_YEAR]=({last});       for (int y=min(@indices(rules));y<=INF_YEAR; y++)    [r2[y],last]=mkperiods(rules[y],last,first);       res+=("class "+    FIXID(id)+"\n"    "{\n"    " inherit TZRules;\n" -  " static array(array(string|int)) jd_year_periods(int jd)\n" +  " protected array(array(string|int)) jd_year_periods(int jd)\n"    " {\n"    " [int y,int yjd,int leap]=gregorian_yjd(jd);\n"    " switch (y)\n"    " {\n");       string s="",t;       int mn=min(@indices(rules-(<NUL_YEAR>)));       for (int y=INF_YEAR;sizeof(r2);y--)
pike.git/lib/modules/Calendar.pmod/mkrules.pike:803:   //   // NOTE: this file is generated by mkrules.pike;   // please do not edit manually /Mirar   // ----------------------------------------------------------------      // ----------------------------------------------------------------   // all rules are based on the gregorian calendar, so   // this is the gregorian rule:   // ----------------------------------------------------------------    - static array gregorian_yjd(int jd) + protected array gregorian_yjd(int jd)   {    int d=jd-1721426;       int century=(4*d+3)/146097;    int century_jd=(century*146097)/4;    int century_day=d-century_jd;    int century_year=(100*century_day+75)/36525;       int y=century*100+century_year+1;   
pike.git/lib/modules/Calendar.pmod/mkrules.pike:830:   }      // ----------------------------------------------------------------   // Base \"Timezone with rules\" class   // ----------------------------------------------------------------      class TZRules   {    constant is_timezone=1;    constant is_dst_timezone=1; -  static int offset_to_utc; +  protected int offset_to_utc;    string name;    -  static function(string:string) tzformat; -  static array names; +  protected function(string:string) tzformat; +  protected array names;    -  static void create(int offset,string _name) +  protected void create(int offset,string _name)    {    offset_to_utc=offset;    name=_name;    if (has_value(name, \"/\"))    {    names=name/\"/\";    tzformat=lambda(string s)    {    if (s==\"\") return names[0]; else return names[1];    };    }    else    tzformat=lambda(string s) { return sprintf(name,s); };    }      // the Rule:   // which julian day does dst start and end this year? -  static array(array(string|int)) jd_year_periods(int jd); +  protected array(array(string|int)) jd_year_periods(int jd);      // is (midnight) this julian day dst?    array tz_jd(int jd)    {    array(array(string|int)) a=jd_year_periods(jd);       int i=0,n=sizeof(a)-1;    while (i<n)    {    array b=a[i+1];