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

1:   //! module Calendar    - // $Id: TimeRanges.pmod,v 1.33 2007/10/12 13:05:51 grubba Exp $ + // $Id: TimeRanges.pmod,v 1.34 2008/02/07 01:39:53 mast Exp $      #pike __REAL_VERSION__   
14:      string _sprintf(int t) { return (t=='O')?calendar_name():0; }    - .Ruleset default_rules=Calendar.default_rules; + Calendar.Ruleset default_rules=Calendar.default_rules;      //------------------------------------------------------------------------   //! class TimeRange
36:   {    constant is_timerange=1;    -  .Ruleset rules; +  Calendar.Ruleset rules;      //! method void create("unix",int unixtime)   //! method void create("unix",int unixtime,int seconds_len)
879:   //! this may include timezone shanges,   //! and change the time of day.    -  this_program set_ruleset(.Ruleset r); -  .Ruleset ruleset() +  this_program set_ruleset(Calendar.Ruleset r); +  Calendar.Ruleset ruleset()    {    return rules;    }
900:   //! <tt>Year(2003)-&gt;...-&gt;set_timezone(TimeZone.CET)-&gt;...-&gt;hour(14)-&gt;...</tt>   //!    -  this_program set_timezone(string|.Rule.Timezone tz) +  this_program set_timezone(string|Calendar.Rule.Timezone tz)    {    return set_ruleset(rules->set_timezone(tz));    }    -  .Rule.Timezone timezone() +  Calendar.Rule.Timezone timezone()    {    return rules->timezone;    }
915:   //! method Language language()   //! Set or get the current language rule.    -  this_program set_language(string|.Rule.Language lang) +  this_program set_language(string|Calendar.Rule.Language lang)    {    return set_ruleset(rules->set_language(lang));    }    -  .Rule.Language language() +  Calendar.Rule.Language language()    {    return rules->language;    }
1143:    return ::_sprintf(t,m);    }    -  TimeRange set_timezone(string|.Rule.Timezone tz) +  TimeRange set_timezone(string|Calendar.Rule.Timezone tz)    {   // fixme?    return `|(@map(parts,"set_timezone",tz));