Branch: Tag:

2004-01-11

2004-01-11 00:52:01 by Martin Nilsson <mani@lysator.liu.se>

this_object() -> this

Rev: lib/modules/ADT.pmod/Priority_queue.pike:1.6
Rev: lib/modules/ADT.pmod/Queue.pike:1.9
Rev: lib/modules/ADT.pmod/Relation.pmod/Binary.pike:1.10
Rev: lib/modules/ADT.pmod/Table.pmod:1.27
Rev: lib/modules/Audio.pmod/Codec.pmod:1.10
Rev: lib/modules/Audio.pmod/Format.pmod/module.pmod:1.7
Rev: lib/modules/Calendar.pmod/Event.pmod:1.22
Rev: lib/modules/Calendar.pmod/Stardate.pmod:1.15
Rev: lib/modules/Calendar.pmod/Time.pmod:1.30
Rev: lib/modules/Calendar.pmod/TimeRanges.pmod:1.27
Rev: lib/modules/Calendar.pmod/Timezone.pmod:1.32
Rev: lib/modules/Calendar.pmod/YMD.pike:1.9
Rev: lib/modules/Calendar.pmod/mkrules.pike:1.10
Rev: lib/modules/Calendar_I.pmod/Gregorian.pmod:1.31
Rev: lib/modules/Calendar_I.pmod/ISO.pmod:1.11
Rev: lib/modules/Calendar_I.pmod/module.pmod:1.15
Rev: lib/modules/Filesystem.pmod/System.pike:1.17
Rev: lib/modules/Filesystem.pmod/Tar.pmod:1.26
Rev: lib/modules/Filesystem.pmod/module.pmod:1.14
Rev: lib/modules/GTKSupport.pmod/Alert.pike:1.6
Rev: lib/modules/GTKSupport.pmod/Util.pmod:1.9
Rev: lib/modules/GTKSupport.pmod/pCtree.pike:1.7
Rev: lib/modules/GTKSupport.pmod/pDrawingArea.pike:1.6
Rev: lib/modules/Languages.pmod/PLIS.pmod:1.19
Rev: lib/modules/Locale.pmod/module.pmod:1.18
Rev: lib/modules/MIME.pmod/module.pmod:1.10
Rev: lib/modules/Parser.pmod/RCS.pike:1.31
Rev: lib/modules/Parser.pmod/XML.pmod/DOM.pmod:1.11
Rev: lib/modules/Parser.pmod/XML.pmod/NSTree.pmod:1.12
Rev: lib/modules/Parser.pmod/XML.pmod/Tree.pmod:1.38
Rev: lib/modules/Protocols.pmod/Bittorrent.pmod/Torrent.pike:1.21
Rev: lib/modules/Protocols.pmod/HTTP.pmod/Query.pike:1.64
Rev: lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Port.pike:1.7
Rev: lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike:1.17
Rev: lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike:1.4
Rev: lib/modules/Protocols.pmod/HTTP.pmod/Session.pike:1.14
Rev: lib/modules/Protocols.pmod/IMAP.pmod/types.pmod:1.30
Rev: lib/modules/Protocols.pmod/IRC.pmod/Client.pike:1.11
Rev: lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1.51
Rev: lib/modules/Protocols.pmod/LDAP.pmod/ldap_privates.pmod:1.7
Rev: lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:1.11
Rev: lib/modules/Protocols.pmod/LysKOM.pmod/Connection.pike:1.11
Rev: lib/modules/Protocols.pmod/LysKOM.pmod/Session.pike:1.33
Rev: lib/modules/Protocols.pmod/LysKOM.pmod/Threads.pike:1.8
Rev: lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike:1.13
Rev: lib/modules/Protocols.pmod/TELNET.pmod:1.23
Rev: lib/modules/Protocols.pmod/X.pmod/Atom.pmod:1.13
Rev: lib/modules/Protocols.pmod/X.pmod/Auth.pmod:1.13
Rev: lib/modules/Protocols.pmod/X.pmod/Extensions.pmod:1.15
Rev: lib/modules/Protocols.pmod/X.pmod/Types.pmod:1.39
Rev: lib/modules/Protocols.pmod/X.pmod/XImage.pmod:1.21
Rev: lib/modules/Protocols.pmod/X.pmod/XTools.pmod:1.9
Rev: lib/modules/Protocols.pmod/X.pmod/Xlib.pmod:1.49
Rev: lib/modules/Remote.pmod/module.pmod:1.3
Rev: lib/modules/SSL.pmod/Cipher.pmod:1.7
Rev: lib/modules/SSL.pmod/connection.pike:1.31
Rev: lib/modules/SSL.pmod/handshake.pike:1.36
Rev: lib/modules/SSL.pmod/session.pike:1.28
Rev: lib/modules/SSL.pmod/sslport.pike:1.12
Rev: lib/modules/Standards.pmod/ASN1.pmod/Types.pmod:1.28
Rev: lib/modules/Standards.pmod/PKCS.pmod/PFX.pmod:1.9
Rev: lib/modules/Standards.pmod/URI.pike:1.17
Rev: lib/modules/Stdio.pmod/FakeFile.pike:1.8
Rev: lib/modules/Tools.pmod/Hilfe.pmod:1.108
Rev: lib/modules/Tools.pmod/Standalone.pmod/rsqld.pike:1.10
Rev: lib/modules/Tools.pmod/X509.pmod:1.21
Rev: lib/modules/Web.pmod/Crawler.pmod:1.19
Rev: lib/modules/Web.pmod/RDF.pike:1.29
Rev: lib/modules/Yabu.pmod/module.pmod:1.28
Rev: lib/modules/_Image_XCF.pmod:1.22

1:   //! module Calendar    - // $Id: TimeRanges.pmod,v 1.26 2003/11/16 16:19:39 grubba Exp $ + // $Id: TimeRanges.pmod,v 1.27 2004/01/11 00:51:22 nilsson Exp $      #pike __REAL_VERSION__   
10:      string calendar_name() { return "TimeRanges"; }    - object calendar_object=this_object(); + object calendar_object=this;      string _sprintf(int t) { return (t=='O')?calendar_name():0; }   
119:    }       error("%O.%O: Illegal parameters %O,%O,%O...\n", -  function_object(object_program(this_object())), -  object_program(this_object()), -  @args,0,0,0); +  function_object(this_program), +  this_program,@args,0,0,0);    }       static void convert_from(TimeRange other)
139:    create("unix_r",other->unix_time(),other->ruleset());    else    error("Can't convert %O->%s.%O\n",other, -  calendar_name(), -  object_program(this_object())); +  calendar_name(), this_program);    }      //! method TimeRange set_size(TimeRange size)
162:    int(0..0x7fffffff) n;    if (!b)    if (intp(a)) -  x=[function|object(TimeRange)]this_object(), -  n=[int(0..0x7fffffff)]a; +  x=this,n=[int(0..0x7fffffff)]a;    else    x=a,n=1;    else
207:    int n;    if (!b)    if (intp(a)) -  x=[function|object(this_program)]this_object(), -  n=[int]a; +  x=this,n=[int]a;    else    x=a,n=1;    else
292:       TimeRange next()    { -  return this_object()+1; +  return this+1;    }       TimeRange prev()    { -  return this_object()-1; +  return this-1;    }      //! method TimeRange `*(int n)
308:    function ``* = `*;    TimeRange `*(int n)    { -  return set_size(n,this_object()); +  return set_size(n,this);    }      //! method array(TimeRange) `/(int n)
416:       int offset_to(TimeRange x)    { -  if (x==this_object()) return 0; -  if (x<this_object()) -  return -(x->distance(this_object())/this_object()); -  return this_object()->distance(x)/this_object(); +  if (x==this) return 0; +  if (x<this) +  return -(x->distance(this)/this); +  return this->distance(x)/this;    }      //! method TimeRange beginning()
530:    {    if (objectp(what) && what->is_supertimerange)    { -  array(int(-1..1)) cmp=what->_compare(this_object()); +  array(int(-1..1)) cmp=what->_compare(this);       return ({-cmp[0],    -cmp[2],
539:    }    return ({-1,-1,-1,-1});   // error("_compare: incompatible classes %O <-> %O\n", - // object_program(this_object()),object_program(what)); + // this_program,object_program(what));    }       string _describe_compare(array(int(-1..1)) c,TimeRange a,TimeRange b)
682:       int(0..1) `==(TimeRange what)    { -  return object_program(what)==object_program(this_object()) && +  return object_program(what)==this_program &&    what->ruleset()==ruleset() &&    equals(what);    }
715:    return nulltimerange; // no overlap, no extra       if (with->is_supertimerange) -  return predef::`&(with,this_object(),@extra); // let it handle that... +  return predef::`&(with,this,@extra); // let it handle that...       TimeRange from,to;   
745:    TimeRange `|(TimeRange with,mixed ...extra)    {    if (with->is_nulltimerange) -  return sizeof(extra)?`|(@extra):this_object(); +  return sizeof(extra)?`|(@extra):this;    array(int(-1..1)) a=_compare(with);    TimeRange from,to;       if (a[END_BEGIN]<0 || a[BEGIN_END]>0) -  from=SuperTimeRange( sort(({this_object(),with})) ); // no overlap +  from=SuperTimeRange( sort(({this,with})) ); // no overlap    else    {    if (with->is_supertimerange) // let it handle that... -  return predef::`|(with,this_object(),@extra); +  return predef::`|(with,this,@extra);       // from the first beginning -  if (a[BEGIN_BEGIN]<0) from=this_object(); else from=with; +  if (a[BEGIN_BEGIN]<0) from=this; else from=with;       // to the last end -  if (a[END_END]>0) to=this_object(); else to=with; +  if (a[END_END]>0) to=this; else to=with;    // compute    from=from->range(to);    }
784:    TimeRange `^(TimeRange with,mixed ... extra)    {    if (with->is_supertimerange) -  return `^(with,this_object(),@extra); // let it handle that... +  return `^(with,this,@extra); // let it handle that...    if (with->is_nulltimerange) -  return sizeof(extra)?`^(@extra):this_object(); +  return sizeof(extra)?`^(@extra):this;       TimeRange res;       array(int(-1..1)) a=_compare(with);    - // write(_describe_compare(a,this_object(),with)); + // write(_describe_compare(a,this,with));       TimeRange first,second;    if (a[END_BEGIN]<0 || a[BEGIN_END]>0) -  res=SuperTimeRange( sort(({this_object(),with})) ); // no overlap +  res=SuperTimeRange( sort(({this,with})) ); // no overlap    else if (a[BEGIN_END]==0 || a[END_BEGIN]==0) // bordering    if (a[BEGIN_BEGIN]<0)    res=range(with); // A precedes B    else -  res=with->range(this_object()); // B precedes A +  res=with->range(this); // B precedes A    else if (a[BEGIN_BEGIN]==0 && a[END_END]==0)    return sizeof(extra)?predef::`^(nulltimerange,@extra):nulltimerange;    else
810:    if (a[BEGIN_BEGIN]<0)    first=distance(with);    else -  first=with->distance(this_object()); +  first=with->distance(this);      // and from the first end to the last end    if (a[END_END]<0)    second=end()->range(with);    else -  second=with->end()->range(this_object()); +  second=with->end()->range(this);    res=first|second;    }    // done
842:    array(int(-1..1)) a=_compare(what);       if (a[END_BEGIN]<=0 || a[BEGIN_END]>=0) -  return sizeof(extra)?subtract(@extra):this_object(); // no overlap +  return sizeof(extra)?subtract(@extra):this; // no overlap       if (what->is_supertimerange)    {
857:       TimeRange res;    - // write(_describe_compare(a,this_object(),what)); + // write(_describe_compare(a,this,what));       if (a[BEGIN_BEGIN]>=0) // it preceeds us    if (a[END_END]<=0)    return nulltimerange; // full overlap    else // half overlap at start -  res=what->end()->range(this_object()); +  res=what->end()->range(this);    else if (a[END_END]<=0) // it succeeds us    res=distance(what);    else
873:   // what->end(),end());   // it's inside us    res=predef::`|(distance(what), -  what->end()->range(this_object())); +  what->end()->range(this));    }    if (sizeof(extra)) return res->subtract(@extra);    return res;
1050:    if (with->is_supertimerange)    res=mend_overlap(sort(with->parts+parts));    else if (with->is_nulltimerange) -  return this_object(); +  return this;    else    res=mend_overlap(sort( ({with})+parts ));    if (sizeof(extra))
1184:       TimeRange set_size(TimeRange|int(0..0x7fffffff) a,void|TimeRange b)    { -  return this_object(); +  return this;    }       TimeRange place(TimeRange what,void|int force)    { -  return this_object(); +  return this;    }       array(TimeRange) split(int n)    { -  return allocate(n,this_object()); +  return allocate(n,this);    }    -  TimeRange beginning() { return this_object(); } -  TimeRange end() { return this_object(); } +  TimeRange beginning() { return this; } +  TimeRange end() { return this; }       TimeRange distance(TimeRange to)    { -  if (to==this_object()) return this_object(); +  if (to==this) return this;    error("Can't distance/space/range with the null timerange\n");    }       array(int(-1..1)) _compare(TimeRange with)    { -  if (with==this_object()) return ({0,0,0,0}); +  if (with==this) return ({0,0,0,0});    return ({-1,-1,-1,-1});    }       int(0..1) `<(TimeRange with)    { -  return !(with==this_object()); +  return !(with==this);    }       int(0..1) `>(TimeRange with)
1234:       TimeRange `&(TimeRange with, mixed ...extra)    { -  return predef::`&(with,this_object(),@extra); +  return predef::`&(with,this,@extra);    }       TimeRange `|(TimeRange with, mixed ...extra)    { -  return predef::`|(with,this_object(),@extra); +  return predef::`|(with,this,@extra);    }       TimeRange `^(TimeRange with, mixed ...extra)    { -  return predef::`^(with,this_object(),@extra); +  return predef::`^(with,this,@extra);    }       this_program subtract(TimeRange with, mixed ...extra)    { -  return this_object(); +  return this;    }       int(1..1) `!()