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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Events.pmod:177:      Event.Namedays find_namedays(string region)   {    string id="namedays/"+region;    object res;    if ( (res=made_namedays[region]) )    return res;    string all=read_all_namedays();       int i=search(all,"\nRegion \""+region+"\""); -  if (i==-1) return ([])[0]; // not found +  if (i==-1) return UNDEFINED; // not found       int i2=search(all,"\nRegion",i+1);    if (i2==-1) i2=strlen(all)-1;       array(array(string)) names=0;    int start=-1,stop=-1;    int leapdayshift=2000;    string charset="iso-8859-1";    function(string:string) decoder=0;   
pike.git/lib/modules/Calendar.pmod/Events.pmod:272:   {    Event.Event e=loaded_events[s];    if (e) return e;       if (!all_data) read_all_data();       if (s[..8]=="namedays/")    return find_namedays(s[9..]);       int i=search(all_data,sprintf("Event %O",s)); -  if (i==-1) return ([])[0]; +  if (i==-1) return UNDEFINED;       int j=search(all_data,"\n",i);    if (j==-1) j=0x7fffffff;    return make_event(all_data[i..j]);   }      Event.Event find_region(string c)   {    Event.Event e=loaded_events[c];    if (e) return e;       if (!all_data) read_all_data();       int i=search(all_data,sprintf("\nRegion %O",c)); -  if (i==-1) return ([])[0]; +  if (i==-1) return UNDEFINED;       int j=search(all_data,"\nRegion \"",i+1);    if (j==-1) j=0x7fffffff;       array(Event) events=({});    mapping(Event:multiset(string)) eflags=([]);    mapping(string:multiset(string)) flagy=([]);       foreach ( (all_data[i..j]/"\n")[2..], string line)    {
pike.git/lib/modules/Calendar.pmod/Events.pmod:387:    if (e=find_region(s)) return e;       if (!country_lookup)    country_lookup=master()->resolv("Geography.Countries");    object c=country_lookup->from_name(s);    if (c && (e=find_region(lower_case(c->iso2)))) return e;       if (s=="tzshift")    return loaded_events->tzshift=Event.TZShift_Event();    -  return ([])[0]; +  return UNDEFINED;   }      Event.SuperEvent country(string s)   {    s=replace(s,"_"," ");    return find_region(s);   }      Event.SuperEvent event(string s)   {    s=replace(s,"_"," ");    return find_event(s);   }      mapping made_events=([]);