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.6 2000/11/08 22:38:41 hubbe Exp $ + // $Id: mkrules.pike,v 1.7 2003/01/20 17:44:00 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:662:    if (rules[s]) rules[s]->add(t);    else (lastr=rules[s]=Rule(s))->add(t),arules+=({lastr});    lastz=0;    }    else if (sscanf(line,"Link%*[ \t]%[^ \t]%*[ \t]%[^ \t]",s,t)==4)    {    // link t to s    if (links[s]) links[s]+=({t});    else links[s]=({t});    } -  else if (sscanf(line,"%*[ \t]%[-0-9]%s",s,t)==3 && strlen(s)) +  else if (sscanf(line,"%*[ \t]%[-0-9]%s",s,t)==3 && sizeof(s))    {    if (!lastz) complain("implicit zone line w/o zone\n");    lastz->add(s+t);    }    else if ((t="",sscanf(line,"%[ \t]",t),t==line))    ;    else if (sscanf(line,"%*[ \t]#%s",t,s)==2)    ;    else    complain("unknown keyword %O...\n",line[..10]);
pike.git/lib/modules/Calendar.pmod/mkrules.pike:701:    write("thinking...\n");       string t=TZrules_base;       foreach (arules,Rule r)    t+=r->dump();       tzrules=compile_string(t)();       mv("TZrules.pmod","TZrules.pmod~"); -  werror("writing TZrules.pmod (%d bytes)...",strlen(t)); +  werror("writing TZrules.pmod (%d bytes)...",sizeof(t));    Stdio.File("TZrules.pmod","wtc")->write(t);    werror("\n");       t="// ----------------------------------------------------------------\n"    "// Timezones\n"    "//\n"    "// NOTE: this file is generated by mkrules.pike;\n"    "// please do not edit manually /Mirar\n"    "// ----------------------------------------------------------------\n"    "\n"
pike.git/lib/modules/Calendar.pmod/mkrules.pike:755:    FIXID(z->id)+";\n";    t+="\n";    }    };    if (err) if (stringp(err)) error(err); else throw(err);       t+=("\n"    "// "+"-"*70+"\n");       mv("TZs.pike","TZs.pike~"); -  werror("writing TZs.h (%d bytes)...",strlen(t)); +  werror("writing TZs.h (%d bytes)...",sizeof(t));    Stdio.File("TZs.h","wtc")->write(t);    werror("\n");       mapping zs=([]);    foreach (azones,Zone z)    if (sscanf(z->id,"%s/%s",string s,string t)==2)    zs[s]=(zs[s]||({}))+({t});       t="// ----------------------------------------------------------------\n"    "// Timezone names\n"
pike.git/lib/modules/Calendar.pmod/mkrules.pike:782:    "([\n";    foreach (indices(zs)-({"SystemV","Etc"}),string co)    t+=(replace(    sprintf(" %-13s({%-=63s\n",    sprintf("%O:",co),    map(zs[co],lambda(string s) { return sprintf("%O",s); })    *", "+"}),"),({", ",", "}),",,"/1));    t+="]);\n\n";       mv("TZnames.pike","TZnames.pike~"); -  werror("writing TZnames.pmod (%d bytes)...",strlen(t)); +  werror("writing TZnames.pmod (%d bytes)...",sizeof(t));    Stdio.File("TZnames.pmod","wtc")->write(t);    werror("\n");       return 0;   }         string TZrules_base=   #"// ----------------------------------------------------------------   // Daylight savings and war time rules