Branch: Tag:

2008-02-07

2008-02-07 01:39:53 by Martin Stjernholm <mast@lysator.liu.se>

Fixes to make it possible to write a compat wrapper for this module: Did
away with all .Foo style identifiers since they _always_ result in a lookup
in the same directory as the current file, even when it's included from
somewhere else.

So if e.g. lib/modules/Calendar.pmod/Time.pmod is #include'd from
lib/7.6/modules/Calendar.pmod/Time.pmod (which we must do to compile it
all in #pike 7.6 mode), and the included Time.pmod contains a reference
.Ruleset, that reference will be resolved in lib/modules/Calendar.pmod.
That's odd and probably buggy, since one would reasonably expect cpp stuff
like #include to be completely transparent for the resolver.

Rev: lib/modules/Calendar.pmod/Austrian.pmod:1.7
Rev: lib/modules/Calendar.pmod/Badi.pmod:1.7
Rev: lib/modules/Calendar.pmod/Calendar.pike:1.7
Rev: lib/modules/Calendar.pmod/Coptic.pmod:1.7
Rev: lib/modules/Calendar.pmod/Discordian.pmod:1.11
Rev: lib/modules/Calendar.pmod/Event.pmod:1.23
Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.10
Rev: lib/modules/Calendar.pmod/ISO.pmod:1.9
Rev: lib/modules/Calendar.pmod/Islamic.pmod:1.10
Rev: lib/modules/Calendar.pmod/Julian.pmod:1.10
Rev: lib/modules/Calendar.pmod/Language.pmod:1.24
Rev: lib/modules/Calendar.pmod/Ruleset.pike:1.15
Rev: lib/modules/Calendar.pmod/Stardate.pmod:1.16
Rev: lib/modules/Calendar.pmod/Swedish.pmod:1.8
Rev: lib/modules/Calendar.pmod/Time.pmod:1.41
Rev: lib/modules/Calendar.pmod/TimeRanges.pmod:1.34
Rev: lib/modules/Calendar.pmod/Timezone.pmod:1.40
Rev: lib/modules/Calendar.pmod/YMD.pike:1.29

16:   //- these classes majorly works on seconds   //- an hour is 3600 seconds, a minute is 60 seconds    - inherit .TimeRanges:TimeRanges; + inherit Calendar.TimeRanges:TimeRanges;      #include "constants.h"   
30:   #error Calendar.Time needs bignums (Gmp.mpz)   #endif    - .Rule.Timezone Timezone_UTC=.Rule.Timezone(0,"UTC"); // needed for dumping + Calendar.Rule.Timezone Timezone_UTC= +  Calendar.Rule.Timezone(0,"UTC"); // needed for dumping      string calendar_name() { return "Time"; }   
80:    switch (args[0])    {    case "timeofday": -  rules=[object(.Ruleset)]args[1]; +  rules=[object(Calendar.Ruleset)]args[1];    ux=[int]args[2];    len=[int]args[3];    ls=CALUNKNOWN;    return;       case "timeofday_sd": -  rules=[object(.Ruleset)]args[1]; +  rules=[object(Calendar.Ruleset)]args[1];    ux=[int]args[2];    len=[int]args[3];    ls=[int]args[4];
948:      // --------    -  this_program set_ruleset(.Ruleset r) +  this_program set_ruleset(Calendar.Ruleset r)    {    return    Second("timeofday",r,ux,len)
1635:    }    else if (args[0]=="timeofday_f")    { -  rules=[object(.Ruleset)]args[1]; +  rules=[object(Calendar.Ruleset)]args[1];    ux=[int]args[2];    ns=[int]args[3];    len_s=[int]args[4];
1665:    else switch (args[0])    {    case "timeofday": -  rules=[object(.Ruleset)]args[1]; +  rules=[object(Calendar.Ruleset)]args[1];    ux=[int]args[2];    len=[int]args[3];    ls=CALUNKNOWN;
1817:    return this;    }    -  this_program set_ruleset(.Ruleset r) +  this_program set_ruleset(Calendar.Ruleset r)    {    return    Fraction("timeofday",r,ux,len,ns)
2073:   //! Result: Fraction(Fri 2 Jun 2000 16:03:02.323912 UTC)   //! </pre>    - this_program set_timezone(string|.Rule.Timezone tz) + this_program set_timezone(string|Calendar.Rule.Timezone tz)   {    return set_ruleset(default_rules->set_timezone(tz));   }    - .Rule.Timezone timezone() + Calendar.Rule.Timezone timezone()   {    return default_rules->timezone;   }    - this_program set_language(string|.Rule.Language lang) + this_program set_language(string|Calendar.Rule.Language lang)   {    return set_ruleset(default_rules->set_language(lang));   }    - .Rule.Language language() + Calendar.Rule.Language language()   {    return default_rules->language;   }
2099:   //! <ref>set_ruleset</ref> returns a new calendar object,   //! but with the new ruleset.    - this_program set_ruleset(.Ruleset r) + this_program set_ruleset(Calendar.Ruleset r)   {    this_program c=this_program();    c->default_rules=r;    return c;   }    - .Ruleset ruleset() + Calendar.Ruleset ruleset()   {    return default_rules;   }