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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:1:   //! module Calendar    - // $Id: TimeRanges.pmod,v 1.32 2006/01/17 16:35:01 mbaehr Exp $ + // $Id: TimeRanges.pmod,v 1.33 2007/10/12 13:05:51 grubba Exp $      #pike __REAL_VERSION__      #define zero int(0..0)      program SuperTimeRange=cSuperTimeRange;      string calendar_name() { return "TimeRanges"; }      object calendar_object=this;
pike.git/lib/modules/Calendar.pmod/TimeRanges.pmod:119:    }       error("%O.%O: Illegal parameters %O,%O,%O...\n",    function_object(this_program),    this_program,@args,0,0,0);    }       static void convert_from(TimeRange other)    {   // inheriting class must take care of size -  if (other->unix_time) -  create("unix_r",other->unix_time(),other->ruleset()); -  else if (other->julian_day) -  create("julian_r",other->julian_day(),other->ruleset()); -  else +  if (other->unix_time) { +  rules = other->ruleset(); +  create_unixtime_default(other->unix_time()); +  } else if (other->julian_day) { +  rules = other->ruleset(); +  create_julian_day(other->julian_day()); +  } else    error("Can't convert %O->%s.%O\n",other,    calendar_name(), this_program);    }      //! method TimeRange set_size(TimeRange size)   //! method TimeRange set_size(int n,TimeRange size)   //! Gives back a new (or the same, if the size matches)   //! timerange with the new size.   //! If <i>n</i> are given, the resulting size   //! will be <i>n</i> amounts of the given size.