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.37 2009/08/19 09:09:12 grubba Exp $ + // $Id$      #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:255:   //! a-b does not give the distance between the start of a and b.   //! Use the <ref>distance</ref>() function to calculate that.   //!   //! The integer used to `+, `- and add are the <i>number</i>   //! of steps the motion will be. It does <i>never</i> represent   //! any <i>fixed</i> amount of time, like seconds or days.       TimeRange `+(program|this_program|int n,    program|this_program|int ... more)    { -  if (sizeof(more)) n = predef::`+(n, @more); -  if (objectp(n)) return add(1,n); -  return add(n); +  TimeRange res; +  if (objectp(n)) res = add(1,n); +  else res = add(n); +  if (sizeof(more)) +  return predef::`+(res, @more); +  return res;    }       TimeRange ``+(int n, int ... more)    {    if (sizeof(more)) n = predef::`+(n, @more);    return add(n);    }       TimeRange `-(program|this_program|int n,    TimeRange|this_program|int ... more)