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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Timezone.pmod:55:   //! way of finding a better timezone to use.   //!   //! This timezone is limited by <ref>localtime</ref> and   //! libc to the range of <tt>time_t</tt>,   //! which is a MAXINT on most systems - 13 Dec 1901 20:45:52   //! to 19 Jan 2038 3:14:07, UTC.      #pike __REAL_VERSION__      // ---------------------------------------------------------------- - // static + // protected      Calendar.Rule.Timezone UTC=Calendar.Rule.Timezone(0,"UTC");      // ----------------------------------------------------------------   // from the system      Calendar.Rule.Timezone locale=0;      protected function(:Calendar.Rule.Timezone) _locale()   {
pike.git/lib/modules/Calendar.pmod/Timezone.pmod:751:    array a= array_sscanf(line, replace("%s %s %s %s %s %s %s %[^\t ]",    " ","%*[ \t]"));       if (sizeof(a)<8) complain("illegal rule line format\n");       if (!(int)a[0] && a[0]!="min")    complain("unknown year %O\n",a[0]);       // ---    - #define INF_YEAR 2050 + #define INF_YEAR 2100   #define NUL_YEAR 1850       int y1=(int)a[0] || NUL_YEAR;    int y2;    if (a[1]=="max") y2=INF_YEAR;    else if (a[1]=="only") y2=y1;    else if (!(y2=(int)a[1]))    complain("unknown year %O\n",a[1]);    else if (y2>=INF_YEAR)    complain("big year\n");
pike.git/lib/modules/Calendar.pmod/Timezone.pmod:1226: Inside #if defined(RTTZC_TIMING)
     #ifdef RTTZC_TIMING    float t3=time(t);    werror("compile %O: %O\n",zone_name,t3-td);   #endif    return zo;    }       }    -  string base_path=combine_path(__FILE__,"../tzdata/"); +  string base_path=combine_path(__DIR__,"tzdata/");    array files=    ({    "africa",    "antarctica",    "asia",    "australasia",    "backward", -  +  "backzone",    "etcetera",    "europe",    "northamerica",    "southamerica",    "pacificnew",    "systemv",    });       mapping zone_cache;    mapping rule_cache;
pike.git/lib/modules/Calendar.pmod/Timezone.pmod:1364:    zone_cache = ([]);    }       object find_zone(string s)    {   #ifdef RTTZC_DEBUG    werror("Searching for zone %O\n",s);   #endif    if (!zone_cache) parse_all_rules();    object ret = zone_cache[s]; -  if (!zero_type(ret)) return ret || UNDEFINED; +  if (!undefinedp(ret)) return ret || UNDEFINED;    Zone z;    if (!(z = zones[s])) {    // Check if it's a known alias.    // Note: TZnames.abbr2zones is sorted with    // the most recent user first.    array(string) a = .TZnames.abbr2zones[s];    if (a && sizeof(a))    return zone_cache[s] = find_zone(a[0]);    return UNDEFINED;    }
pike.git/lib/modules/Calendar.pmod/Timezone.pmod:1404:    return ret;    }       int main(int ac,array(string) am)    {    map(am[1..],find_zone);    return 0;    }      // ---------------------------------------------------------------- - // Base class for daylight savings and war time rules + // Base class for daylight-saving and war time rules   // ----------------------------------------------------------------      // ----------------------------------------------------------------   // Base "Timezone with rules" class   // ----------------------------------------------------------------       class TZRules    {    constant is_timezone=1;    constant is_dst_timezone=1;
pike.git/lib/modules/Calendar.pmod/Timezone.pmod:1458:    {    if (s=="") return names[0]; else return names[1];    }    else    return sprintf(name,s);    }       protected void create(int offset,string name)    {    offset_to_utc=offset; -  this_program::name=name; +  this::name=name;    if (has_value(name, "/"))    {    names=name/"/";    }    }      // the Rule:   // which julian day does dst start and end this year?    protected array(array(string|int)) jd_year_periods(int jd);