Changeset 2173

Show
Ignore:
Timestamp:
06/07/08 09:28:19 (6 months ago)
Author:
mbr
Message:

updated to version 5.4 from 5.3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psad/trunk/Date-Calc/CHANGES.txt

    r737 r2173  
    11                     ==================================== 
    2                        Package "Date::Calc" Version 5.3 
     2                       Package "Date::Calc" Version 5.4 
    33                     ==================================== 
    44 
    55 
    6                   Copyright (c) 1995 - 2002 by Steffen Beyer. 
     6                  Copyright (c) 1995 - 2004 by Steffen Beyer. 
    77                             All rights reserved. 
    88 
     
    1010Version history: 
    1111---------------- 
     12 
     13Version 5.4   03.10.2004 
     14 
     15 +  Added compiler directives for C++. 
     16 +  Removed "Carp::Clan" from the distribution (available separately). 
     17 +  Fixed bug in initialization of "Date::Calendar::Year" objects. 
     18 +  Added method "tags()" to "Date::Calendar" and "Date::Calendar::Year". 
     19 +  Fixed the formula for "Labor Day" in the U.S. to "1/Mon/Sep". 
     20 +  Added a new recipe to the "Date::Calc" documentation. 
     21 +  Added Romanian to the list of languages supported by "Date::Calc". 
     22 +  Changed the example script "calendar.cgi" to highlight the name 
     23    which led to a given date being a holiday. 
     24 +  Fixed the Polish entries in "Date::Calc". 
     25 +  Added a few commemorative days to the Norwegian calendar profile. 
     26 +  Added "use bytes" to all Perl files to avoid problems on systems 
     27    not using the standard locale "C". 
     28 +  Fixed test 5 of t/m005.t to (hopefully) work under other locales. 
    1229 
    1330Version 5.3   29.09.2002 
  • psad/trunk/Date-Calc/CREDITS.txt

    r737 r2173  
    11                     ==================================== 
    2                        Package "Date::Calc" Version 5.3 
     2                       Package "Date::Calc" Version 5.4 
    33                     ==================================== 
    44 
    55 
    6                   Copyright (c) 1995 - 2002 by Steffen Beyer. 
     6                  Copyright (c) 1995 - 2004 by Steffen Beyer. 
    77                             All rights reserved. 
    88 
     
    365365The bug hasn't been fixed yet, but there is a workaround which seems 
    366366to remedy the problem: First add one workday to the date in question, 
    367 and then subtract one workday more than you initially intended. 
    368  
    369  
     367and then subtract one workday more than initially. 
     368 
     369Many thanks to Mike Swieton <swietonm@student.gvsu.edu> (and many other 
     370people in the past) for sending in a patch so that ToolBox.h will compile 
     371with C++ compilers. 
     372 
     373Thanks to Joe Rice <riceja@water-melon.net> and Sridhar Gopal 
     374<sridhar.gopal@bankofamerica.com> for pointing out that the formula 
     375for Labor Day in the U.S. apparently was wrong; it returned 
     376September 8th in 2003 but Labor Day in that year actually was on 
     377September 1st. It should obviously be "1/Mon/Sep" instead. 
     378 
     379Many thanks to M.S. Tawfik <mstawfik@optonline.net> for finding a 
     380bug in the "init()" method of Date::Calendar::Year when the year 
     381starts with a Sunday (such as in 1995) and for sending a patch! 
     382 
     383Thanks to George Cooke <quatto@hotmail.com> for raising the question 
     384of how to "normalize" the results of the "Delta_YMD()" function to 
     385show only positive values, the answer to which has been included as 
     386a "recipe" in the documentation of Date::Calc. 
     387 
     388Thanks to Joachim Ansorg <joachim@ansorgs.de> for sending me the 
     389necessary information to add Romanian to the list of languages 
     390supported by Date::Calc. 
     391 
     392Many thanks to Peter Prymmer <PPrymmer@factset.com> for suggesting 
     393a work-around for the problems that can arise when a locale other 
     394than "C" is used! 
     395 
     396Thanks to Olle E. Johansson <oej@edvina.net> for sending corrections 
     397for the Swedish calendar profile. 
     398 
     399Thanks to Harold van Oostrom <perl@lanceerplaats.nl> for sending in a 
     400fix for the Polish language in Date::Calc. Also many thanks for his patch 
     401to make Date::Calc ready for UTF-8, which unfortunately I haven't had 
     402the time yet to evaluate. 
     403 
     404Many thanks also to Sven Geisler <sgeisler@aeccom.com> for sending me 
     405corrections for the profile and official references for ALL federal 
     406states of Australia. 
     407 
     408Many thanks to Tony Mountifield <tony@mountifield.org> for sending 
     409in a patch to enable Date::Calc to handle negative values of time_t, 
     410for dates before the Epoch. I decided not to include it at this time 
     411first because the system functions such as localtime, gmtime and 
     412mktime are considered legacy functions due to their rather restricted 
     413range (Date::Calc's own functions operate on a much broader range), 
     414and second because it cost so much effort to make these functions 
     415work in Date::Calc under Unix and Windows as well as under MacOS 
     416(Classic), that the risk of breaking things is just too high, not 
     417to mention the time and effort needed to get it right again, which 
     418I can't spend at the moment, unfortunately. So please use Date::Calc's 
     419own functions instead, which cover the intended range of dates anyway. 
     420 
     421Thanks a lot to Can Bican <can@ripe.net>, Ziya Suzen <ziya@ripe.net>, 
     422Henk Uijterwaal <henk@ripe.net> and the Amsterdam Perl Mongers for 
     423providing me with more detailed information concerning the 
     424"Bevrijdingsdag" (5th of May) in the Netherlands. 
     425 
     426Many thanks to Vetle Roeim <vetler@opera.com> for sending some more 
     427commemorative days (some companies give half a day off) for the 
     428Norwegian profile. 
     429 
     430 
  • psad/trunk/Date-Calc/Calc.pm

    r737 r2173  
    22############################################################################### 
    33##                                                                           ## 
    4 ##    Copyright (c) 1995 - 2002 by Steffen Beyer.                            ## 
     4##    Copyright (c) 1995 - 2004 by Steffen Beyer.                            ## 
    55##    All rights reserved.                                                   ## 
    66##                                                                           ## 
     
    1212package Date::Calc; 
    1313 
     14BEGIN { eval { require bytes; }; } 
    1415use strict; 
    1516use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); 
     
    99100################################################## 
    100101 
    101 $VERSION = '5.3'; 
     102$VERSION = '5.4'; 
    102103 
    103104bootstrap Date::Calc $VERSION; 
  • psad/trunk/Date-Calc/Calc.pod

    r737 r2173  
    588588"C<Day_of_Year($year,12,31)>" returns either "C<365>" or "C<366>". 
    589589 
     590The day of year is sometimes also referred to as the Julian day (or date), 
     591although it has nothing to do with the Julian calendar, the calendar which 
     592was used before the Gregorian calendar. 
     593 
     594In order to convert the number returned by this function back into a 
     595date, use the function "C<Add_Delta_Days()>" (described further below), 
     596as follows: 
     597 
     598  $doy = Day_of_Year($year,$month,$day); 
     599  ($year,$month,$day) = Add_Delta_Days($year,1,1, $doy - 1); 
     600 
    590601=item * 
    591602 
     
    601612This is sometimes also referred to (not quite correctly) as the Julian 
    602613date (or day). This may cause confusion, because also the number of the 
    603 day in a year (from 1 to 365 or 366) is frequently called the "Julian date". 
    604  
    605 In fact the calendar that was used B<BEFORE> the Gregorian calendar 
    606 was the Julian calendar - named after famous Julius Caesar, who had 
    607 instituted it in Roman times. The Julian calendar was less precise 
    608 because it had too many leap years compared to the true mean length 
    609 of a year, and because rulers often changed it arbitrarily, in order 
    610 to lengthen their own reign, for instance. 
     614day in a year (from 1 to 365 or 366) is frequently called the "Julian day". 
     615 
     616More confusing still, this has nothing to do with the Julian calendar, 
     617which was used B<BEFORE> the Gregorian calendar. 
     618 
     619The Julian calendar was named after famous Julius Caesar, who had 
     620instituted it in Roman times. The Julian calendar is less precise than 
     621the Gregorian calendar because it has too many leap years compared to 
     622the true mean length of a year (but the Gregorian calendar also still 
     623has one day too much every 5000 years). Anyway, the Julian calendar was 
     624better than what existed before, because rulers had often changed the 
     625calendar used until then in arbitrary ways, in order to lengthen their 
     626own reign, for instance. 
    611627 
    612628In order to convert the number returned by this function back into 
     
    14691485LANGUAGE ITSELF>), or any uniquely identifying abbreviation of the name 
    14701486of a language (i.e., the first few letters), and returns its corresponding 
    1471 internal number (1..13 in the original distribution) upon a successful match, 
     1487internal number (1..14 in the original distribution) upon a successful match, 
    14721488or "C<0>" otherwise (therefore, the return value can also be used as the 
    14731489conditional expression in an "if" statement). 
     
    14941510            suomi       (Finnish)      ==>   11 
    14951511            Magyar      (Hungarian)    ==>   12 
    1496             Polski      (Polish)       ==>   13 
     1512            polski      (Polish)       ==>   13 
     1513            Romaneste   (Romanian)     ==>   14 
    14971514 
    14981515See the section "How to install additional languages" in the file 
     
    18611878 12  Hungarian  :  "dd. Mmmmmm yyyy., wwwwww" 
    18621879 13  Polish     :  "Wwwwww, dd Mmmmmm yyyy" 
     1880 14  Romanian   :  "Wwwwww dd Mmmmmm yyyy" 
    18631881 
    18641882(You can change these formats in the file "DateCalc.c" before 
     
    19862004           11   ==>   suomi       (Finnish) 
    19872005           12   ==>   Magyar      (Hungarian) 
    1988            13   ==>   Polski      (Polish) 
     2006           13   ==>   polski      (Polish) 
     2007           14   ==>   Romaneste   (Romanian) 
    19892008 
    19902009See the section "How to install additional languages" in the file 
     
    20272046           11   ==>   suomi       (Finnish) 
    20282047           12   ==>   Magyar      (Hungarian) 
    2029            13   ==>   Polski      (Polish) 
     2048           13   ==>   polski      (Polish) 
     2049           14   ==>   Romaneste   (Romanian) 
    20302050 
    20312051See the section "How to install additional languages" in the file 
     
    20842104 
    20852105In the original distribution of this package there are thirteen built-in 
    2086 languages, therefore the value returned by this function will be "C<13>" 
     2106languages, therefore the value returned by this function will be "C<14>" 
    20872107if no other languages have been added to your particular installation. 
    20882108 
     
    28122832See L<Date::Calendar(3)> for how to do that. 
    28132833 
     2834=item 17) 
     2835 
     2836How can I "normalize" the output of the "Delta_YMDHMS()" (or "Delta_YMD()") 
     2837function so that it contains only positive values? 
     2838 
     2839I.e., how can I show a difference in date (and time) in a more human-readable 
     2840form, for example in order to show how much time until (or since) the expiration 
     2841of something (e.g. an account, a domain, a credit card, etc.) is left (has passed)? 
     2842 
     2843a) Delta_YMDHMS(): 
     2844 
     2845  #!perl 
     2846  use strict; 
     2847  use Date::Calc qw(Today_and_Now Delta_YMDHMS Add_Delta_YMDHMS Delta_DHMS Date_to_Text); 
     2848 
     2849  my $today = [Today_and_Now()]; 
     2850  my $target = [2005,1,1,0,0,0]; 
     2851 
     2852  my $sign = "until"; 
     2853  my $delta = Normalize_Delta_YMDHMS($today,$target); 
     2854  if ($delta->[0] < 0) 
     2855  { 
     2856      $sign = "since"; 
     2857      $delta = Normalize_Delta_YMDHMS($target,$today); 
     2858  } 
     2859  printf("Today is %s %02d:%02d:%02d\n", Date_to_Text(@{$today}[0..2]), @{$today}[3..5]); 
     2860  printf 
     2861  ( 
     2862      "%d year%s, %d month%s, %d day%s, %d hour%s, %d minute%s, %d second%s %s %s %02d:%02d:%02d\n", 
     2863      $delta->[0], (($delta->[0]==1)?'':'s'), 
     2864      $delta->[1], (($delta->[1]==1)?'':'s'), 
     2865      $delta->[2], (($delta->[2]==1)?'':'s'), 
     2866      $delta->[3], (($delta->[3]==1)?'':'s'), 
     2867      $delta->[4], (($delta->[4]==1)?'':'s'), 
     2868      $delta->[5], (($delta->[5]==1)?'':'s'), 
     2869      $sign, 
     2870      Date_to_Text(@{$target}[0..2]), 
     2871      @{$target}[3..5] 
     2872  ); 
     2873 
     2874  sub Normalize_Delta_YMDHMS 
     2875  { 
     2876      my($date1,$date2) = @_; 
     2877      my(@delta); 
     2878 
     2879      @delta = Delta_YMDHMS(@$date1,@$date2); 
     2880      while ($delta[1] < 0 or 
     2881             $delta[2] < 0 or 
     2882             $delta[3] < 0 or 
     2883             $delta[4] < 0 or 
     2884             $delta[5] < 0) 
     2885      { 
     2886          if ($delta[1] < 0) { $delta[0]--; $delta[1] += 12; } 
     2887          if ($delta[2] < 0) 
     2888          { 
     2889              $delta[1]--; 
     2890              @delta[2..5] = (0,0,0,0); 
     2891              @delta[2..5] = Delta_DHMS(Add_Delta_YMDHMS(@$date1,@delta),@$date2); 
     2892          } 
     2893          if ($delta[3] < 0) { $delta[2]--; $delta[3] += 24; } 
     2894          if ($delta[4] < 0) { $delta[3]--; $delta[4] += 60; } 
     2895          if ($delta[5] < 0) { $delta[4]--; $delta[5] += 60; } 
     2896      } 
     2897      return \@delta; 
     2898  } 
     2899 
     2900b) Delta_YMD(): 
     2901 
     2902  #!perl 
     2903  use strict; 
     2904  use Date::Calc qw(Today Delta_YMD Add_Delta_YM Delta_Days Date_to_Text); 
     2905 
     2906  my($sign,$delta); 
     2907  my $today = [Today()]; 
     2908  my $target = [2005,1,1]; 
     2909 
     2910  if (Delta_Days(@$today,@$target) < 0) 
     2911  { 
     2912      $sign = "since"; 
     2913      $delta = Normalize_Delta_YMD($target,$today); 
     2914  } 
     2915  else 
     2916  { 
     2917      $sign = "until"; 
     2918      $delta = Normalize_Delta_YMD($today,$target); 
     2919  } 
     2920  print "Today is ", Date_to_Text(@$today), "\n"; 
     2921  printf 
     2922  ( 
     2923      "%d year%s, %d month%s, %d day%s %s %s\n", 
     2924      $delta->[0], (($delta->[0]==1)?'':'s'), 
     2925      $delta->[1], (($delta->[1]==1)?'':'s'), 
     2926      $delta->[2], (($delta->[2]==1)?'':'s'), 
     2927      $sign, 
     2928      Date_to_Text(@$target) 
     2929  ); 
     2930 
     2931  sub Normalize_Delta_YMD 
     2932  { 
     2933      my($date1,$date2) = @_; 
     2934      my(@delta); 
     2935 
     2936      @delta = Delta_YMD(@$date1,@$date2); 
     2937      while ($delta[1] < 0 or $delta[2] < 0) 
     2938      { 
     2939          if ($delta[1] < 0) { $delta[0]--; $delta[1] += 12; } 
     2940          if ($delta[2] < 0) 
     2941          { 
     2942              $delta[1]--; 
     2943              $delta[2] = Delta_Days(Add_Delta_YM(@$date1,@delta[0,1]),@$date2); 
     2944          } 
     2945      } 
     2946      return \@delta; 
     2947  } 
     2948 
     2949Note that for normalizing just a time vector, you can use the built-in 
     2950function "Normalize_DHMS()". However, this will yield either all positive 
     2951B<OR> all negative values, B<NOT> all positive values as above. 
     2952 
    28142953=back 
    28152954 
     
    28342973=head1 VERSION 
    28352974 
    2836 This man page documents "Date::Calc" version 5.3
     2975This man page documents "Date::Calc" version 5.4
    28372976 
    28382977=head1 AUTHOR 
     
    28442983=head1 COPYRIGHT 
    28452984 
    2846 Copyright (c) 1995 - 2002 by Steffen Beyer. All rights reserved. 
     2985Copyright (c) 1995 - 2004 by Steffen Beyer. All rights reserved. 
    28472986 
    28482987=head1 LICENSE 
  • psad/trunk/Date-Calc/Calc.xs

    r737 r2173  
    33/*****************************************************************************/ 
    44/*                                                                           */ 
    5 /*    Copyright (c) 1995 - 2002 by Steffen Beyer.                            */ 
     5/*    Copyright (c) 1995 - 2004 by Steffen Beyer.                            */ 
    66/*    All rights reserved.                                                   */ 
    77/*                                                                           */ 
  • psad/trunk/Date-Calc/Calendar.pm

    r737 r2173  
    22############################################################################### 
    33##                                                                           ## 
    4 ##    Copyright (c) 2000 - 2002 by Steffen Beyer.                            ## 
     4##    Copyright (c) 2000 - 2004 by Steffen Beyer.                            ## 
    55##    All rights reserved.                                                   ## 
    66##                                                                           ## 
     
    1212package Date::Calendar; 
    1313 
     14BEGIN { eval { require bytes; }; } 
    1415use strict; 
    1516use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION ); 
     
    2324@EXPORT_OK = qw(); 
    2425 
    25 $VERSION = '5.3'; 
     26$VERSION = '5.4'; 
    2627 
    2728use Carp::Clan qw(^Date::); 
     
    157158} 
    158159 
     160sub tags 
     161{ 
     162    my($self) = shift; 
     163    my(%result) = (); 
     164    my(@date); 
     165 
     166    if (@_) 
     167    { 
     168        @date = shift_date(\@_); 
     169        return $self->year($date[0])->tags(@date); 
     170    } 
     171    else { return \%result; } 
     172} 
     173 
    159174sub delta_workdays 
    160175{ 
  • psad/trunk/Date-Calc/Calendar.pod

    r737 r2173  
    5151  @dates        = $calendar->search(PATTERN); 
    5252  $dates        = $calendar->search(PATTERN); 
     53 
     54  $hashref      = $calendar->tags(YEAR,MONTH,DAY|DATE); 
    5355 
    5456  $days         = $calendar->delta_workdays(YEAR1,MONTH1,DAY1|DATE1 
     
    293295In scalar context, only the number of items in the resulting list 
    294296is returned, instead of the resulting list itself (as in list context). 
     297 
     298=item * 
     299 
     300C<$hashref = $calendar-E<gt>tags(YEAR,MONTH,DAY|DATE);> 
     301 
     302This method returns a hash reference for the given calendar and 
     303date. The hash it refers to is a copy of the calendar profile's 
     304internal hash which contains the names for the given date as keys 
     305and 0, 1, 2, or 3 as their corresponding values meaning the following: 
     306 
     307    0    =>    commemorative day 
     308    1    =>    "half" holiday 
     309    2    =>    "full" holiday 
     310    3    =>    both a "half" and a "full" holiday 
     311 
     312The value "3" should only occur if a date has been redefined by the 
     313underlying profile using the same key (i.e., the same name) but with 
     314a different type of holiday. 
    295315 
    296316=item * 
     
    514534Date::Calc::Object(3), Date::Calc(3), Bit::Vector(3). 
    515535 
     536=head1 KNOWN BUGS 
     537 
     538The method "add_delta_workdays()" is known to produce results 
     539which are sometimes off by one working day when a negative 
     540offset is used. As a workaround, try to add one working day 
     541first and then subtract one working day more than initially 
     542intended. See also the file "examples/bug.pl" for how to do 
     543this. 
     544 
    516545=head1 VERSION 
    517546 
    518 This man page documents "Date::Calendar" version 5.3
     547This man page documents "Date::Calendar" version 5.4
    519548 
    520549=head1 AUTHOR 
     
    526555=head1 COPYRIGHT 
    527556 
    528 Copyright (c) 2000 - 2002 by Steffen Beyer. All rights reserved. 
     557Copyright (c) 2000 - 2004 by Steffen Beyer. All rights reserved. 
    529558 
    530559=head1 LICENSE 
  • psad/trunk/Date-Calc/DateCalc.c

    r737 r2173  
    404404}; 
    405405 
    406 #define DateCalc_LANGUAGES 13 
    407  
    408 Z_int DateCalc_Language = 1; /* Default = 1 (English) */ 
     406#define DateCalc_LANGUAGES 14 
     407 
     408Z_int DateCalc_Language = 1; /* Default = 1 (English) */ 
    409409 
    410410const N_char DateCalc_Month_to_Text_[DateCalc_LANGUAGES+1][13][32] = 
     
    464464    }, 
    465465    { 
    466         "???", "Styczen", "Luty", "Marzec", "Kwiecien", "Maj", "Czerwiec", 
    467         "Lipiec", "Sierpien", "Wrzesien", "Pazdziernik", "Listopad", "Grudzien" 
     466        "???", "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", 
     467        "lipca", "sierpnia", "wrzesnia", "pazdziernika", "listopada", "grudnia" 
     468     /* "???", "Styczen", "Luty", "Marzec", "Kwiecien", "Maj", "Czerwiec", */ /* non-flected? */ 
     469     /* "Lipiec", "Sierpien", "Wrzesien", "Pazdziernik", "Listopad", "Grudzien" */ 
    468470     /* "???", "Styczeñ", "Luty", "Marzec", "Kwiecieñ", "Maj", "Czerwiec", */ /* ISO-Latin-2 */ 
    469471     /* "Lipiec", "Sierpieñ", "Wrzesieñ", "PaŒdziernik", "Listopad", "Grudzieñ" */ 
     472    }, 
     473    { 
     474        "???", "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", 
     475        "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" 
    470476    } 
    471477}; 
     
    526532    }, 
    527533    { 
    528         "???", "Poniedzialek", "Wtorek", "Sroda", 
    529         "Czwartek", "Piatek", "Sobota", "Niedziela" 
     534        "???", "poniedzialek", "wtorek", "srodek", 
     535        "czwartek", "piatek", "sobota", "niedziele" 
     536     /* "???", "Poniedzialek", "Wtorek", "Sroda", */ /* non-flected? */ 
     537     /* "Czwartek", "Piatek", "Sobota", "Niedziela" */ 
    530538     /* "???", "Poniedzia³ek", "Wtorek", "Šroda", */ /* ISO-Latin-2 */ 
    531539     /* "Czwartek", "Pi±tek", "Sobota", "Niedziela" */ 
     540    }, 
     541    { 
     542        "???", "Luni", "Marti", "Miercuri", 
     543        "Joi", "Vineri", "Sambata", "Duminica" 
    532544    } 
    533545}; 
     
    580592        "???", "Pn", "Wt", "Sr", "Cz", "Pt", "So", "Ni"    /* 13 */ 
    581593     /* "???", "Pn", "Wt", "Šr", "Cz", "Pt", "So", "Ni" */ /* 13 */ /* ISO-Latin-2 */ 
     594    }, 
     595    { 
     596        "", "", "", "", "", "", "", ""    /* 14 */ 
    582597    } 
    583598}; 
     
    606621    "%s, %d. %sta %d",                  /* 11  suomi       */ 
    607622    "%d. %s %d., %s",                   /* 12  Magyar      */ 
    608     "%s, %d %s %d"                      /* 13  Polski      */ 
     623    "%s, %d %s %d",                     /* 13  polski      */ 
     624    "%s %d %s %d"                       /* 14  Romaneste   */ 
    609625}; 
    610626 
     
    613629    "???", "English", "Français", "Deutsch", "Español", 
    614630    "Português", "Nederlands", "Italiano", "Norsk", "Svenska", 
    615     "Dansk", "suomi", "Magyar", "Polski
     631    "Dansk", "suomi", "Magyar", "polski", "Romaneste
    616632}; 
    617633 
     
    22202236charptr DateCalc_Version(void) 
    22212237{ 
    2222     return( (charptr) "5.3" ); 
    2223 } 
    2224  
    2225 /*****************************************************************************/ 
    2226 /*  VERSION:  5.3                                                            */ 
     2238    return( (charptr) "5.4" ); 
     2239} 
     2240 
     2241/*****************************************************************************/ 
     2242/*  VERSION:  5.4                                                            */ 
    22272243/*****************************************************************************/ 
    22282244/*  VERSION HISTORY:                                                         */ 
    22292245/*****************************************************************************/ 
    22302246/*                                                                           */ 
    2231 /*    Version 5.3   29.09.02  No changes.                                    */ 
    2232 /*    Version 5.2   18.09.02  No changes.                                    */ 
    2233 /*    Version 5.1   08.09.02  Added conditional changes for MacOS/MacPerl.   */ 
    2234 /*    Version 5.0   10.10.01  New YMD/HMS functions, replaced <ctype.h>, ... */ 
    2235 /*    Version 4.3   08.01.00  decode_date_??: (yy < 70 ? 20yy : 19yy)        */ 
    2236 /*    Version 4.2   07.09.98  No changes.                                    */ 
    2237 /*    Version 4.1   08.06.98  Fixed bug in "add_delta_ymd()".                */ 
    2238 /*    Version 4.0   12.05.98  Major rework. Added multi-language support.    */ 
    2239 /*    Version 3.2   15.06.97  Added "week_of_year()".                        */ 
    2240 /*    Version 3.1   12.06.97  No significant changes.                        */ 
    2241 /*    Version 3.0   16.02.97  Changed conventions for unsuccessful returns.  */ 
    2242 /*    Version 2.3   22.11.96  Fixed unbalanced "malloc" and "free".          */ 
    2243 /*    Version 2.2   26.05.96  No significant changes.                        */ 
    2244 /*    Version 2.1   26.05.96  Fixed HH MM SS parameter checks.               */ 
    2245 /*    Version 2.0   25.05.96  Added time calculations. Major rework.         */ 
    2246 /*    Version 1.6   20.04.96  Not published.                                 */ 
    2247 /*    Version 1.5   14.03.96  No significant changes.                        */ 
    2248 /*    Version 1.4   11.02.96  No significant changes.                        */ 
    2249 /*    Version 1.3   10.12.95  Added "days_in_month()".                       */ 
    2250 /*    Version 1.2b  27.11.95  No significant changes.                        */ 
    2251 /*    Version 1.2a  21.11.95  Fix for type name clashes.                     */ 
    2252 /*    Version 1.1   18.11.95  Fix for type name clashes.                     */ 
    2253 /*    Version 1.01  16.11.95  Improved compliance w/ programming standards.  */ 
    2254 /*    Version 1.0   14.11.95  First version under UNIX (with Perl module).   */ 
    2255 /*    Version 0.9   01.11.93  First version of C library under MS-DOS.       */ 
     2247/*    Version 5.4  03.10.04  Added compiler directives for C++.              */ 
     2248/*    Version 5.3  29.09.02  No changes.                                     */ 
     2249/*    Version 5.2  18.09.02  No changes.                                     */ 
     2250/*    Version 5.1  08.09.02  Added conditional changes for MacOS/MacPerl.    */ 
     2251/*    Version 5.0  10.10.01  New YMD/HMS functions, replaced <ctype.h>, ...  */ 
     2252/*    Version 4.3  08.01.00  decode_date_??: (yy < 70 ? 20yy : 19yy)         */ 
     2253/*    Version 4.2  07.09.98  No changes.                                     */ 
     2254/*    Version 4.1  08.06.98  Fixed bug in "add_delta_ymd()".                 */ 
     2255/*    Version 4.0  12.05.98  Major rework. Added multi-language support.     */ 
     2256/*    Version 3.2  15.06.97  Added "week_of_year()".                         */ 
     2257/*    Version 3.1  12.06.97  No significant changes.                         */ 
     2258/*    Version 3.0  16.02.97  Changed conventions for unsuccessful returns.   */ 
     2259/*    Version 2.3  22.11.96  Fixed unbalanced "malloc" and "free".           */ 
     2260/*    Version 2.2  26.05.96  No significant changes.                         */ 
     2261/*    Version 2.1  26.05.96  Fixed HH MM SS parameter checks.                */ 
     2262/*    Version 2.0  25.05.96  Added time calculations. Major rework.          */ 
     2263/*    Version 1.6  20.04.96  Not published.                                  */ 
     2264/*    Version 1.5  14.03.96  No significant changes.                         */ 
     2265/*    Version 1.4  11.02.96  No significant changes.                         */ 
     2266/*    Version 1.3  10.12.95  Added "days_in_month()".                        */ 
     2267/*    Version 1.2b 27.11.95  No significant changes.                         */ 
     2268/*    Version 1.2a 21.11.95  Fix for type name clashes.                      */ 
     2269/*    Version 1.1  18.11.95  Fix for type name clashes.                      */ 
     2270/*    Version 1.01 16.11.95  Improved compliance w/ programming standards.   */ 
     2271/*    Version 1.0  14.11.95  First version under UNIX (with Perl module).    */ 
     2272/*    Version 0.9  01.11.93  First version of C library under MS-DOS.        */ 
    22562273/*                                                                           */ 
    22572274/*****************************************************************************/ 
     
    22672284/*****************************************************************************/ 
    22682285/*                                                                           */ 
    2269 /*    Copyright (c) 1993 - 2002 by Steffen Beyer.                            */ 
     2286/*    Copyright (c) 1993 - 2004 by Steffen Beyer.                            */ 
    22702287/*    All rights reserved.                                                   */ 
    22712288/*                                                                           */ 
  • psad/trunk/Date-Calc/DateCalc.h

    r737 r2173  
    11#ifndef MODULE_DATE_CALC 
    22#define MODULE_DATE_CALC 
     3#ifdef __cplusplus 
     4extern "C" 
     5{ 
     6#endif 
    37/*****************************************************************************/ 
    48/*  MODULE NAME:  DateCalc.h                            MODULE TYPE:  (lib)  */ 
     
    408412*/ 
    409413 
    410 #define DateCalc_LANGUAGES 13 
    411  
    412 extern Z_int DateCalc_Language; /* Default = 1 (English) */ 
     414#define DateCalc_LANGUAGES 14 
     415 
     416extern Z_int DateCalc_Language; /* Default = 1 (English) */ 
    413417 
    414418extern const N_char DateCalc_Month_to_Text_[DateCalc_LANGUAGES+1][13][32]; 
     
    469473    }, 
    470474    { 
    471         "???", "Styczen", "Luty", "Marzec", "Kwiecien", "Maj", "Czerwiec", 
    472         "Lipiec", "Sierpien", "Wrzesien", "Pazdziernik", "Listopad", "Grudzien" 
     475        "???", "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", 
     476        "lipca", "sierpnia", "wrzesnia", "pazdziernika", "listopada", "grudnia" 
     477    }, 
     478    { 
     479        "???", "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", 
     480        "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" 
    473481    } 
    474482}; 
     
    531539    }, 
    532540    { 
    533         "???", "Poniedzialek", "Wtorek", "Sroda", 
    534         "Czwartek", "Piatek", "Sobota", "Niedziela" 
     541        "???", "poniedzialek", "wtorek", "srodek", 
     542        "czwartek", "piatek", "sobota", "niedziele" 
     543    }, 
     544    { 
     545        "???", "Luni", "Marti", "Miercuri", 
     546        "Joi", "Vineri", "Sambata", "Duminica" 
    535547    } 
    536548}; 
     
    584596    { 
    585597        "???", "Pn", "Wt", "Sr", "Cz", "Pt", "So", "Ni" 
     598    }, 
     599    { 
     600        "", "", "", "", "", "", "", "" 
    586601    } 
    587602}; 
     
    614629    "%s, %d. %sta %d", 
    615630    "%d. %s %d., %s", 
    616     "%s, %d %s %d" 
     631    "%s, %d %s %d", 
     632    "%s %d %s %d" 
    617633}; 
    618634*/ 
     
    623639    "???", "English", "Français", "Deutsch", "Español", 
    624640    "Português", "Nederlands", "Italiano", "Norsk", "Svenska", 
    625     "Dansk", "suomi", "Magyar", "Polski
     641    "Dansk", "suomi", "Magyar", "polski", "Romaneste
    626642}; 
    627643*/ 
     
    632648 
    633649/*****************************************************************************/ 
    634 /*  VERSION:  5.3                                                            */ 
     650/*  VERSION:  5.4                                                            */ 
    635651/*****************************************************************************/ 
    636652/*  VERSION HISTORY:                                                         */ 
    637653/*****************************************************************************/ 
    638654/*                                                                           */ 
    639 /*    Version 5.3   29.09.02  No changes.                                    */ 
    640 /*    Version 5.2   18.09.02  No changes.                                    */ 
    641 /*    Version 5.1   08.09.02  Added conditional changes for MacOS/MacPerl.   */ 
    642 /*    Version 5.0   10.10.01  New YMD/HMS functions, replaced <ctype.h>, ... */ 
    643 /*    Version 4.3   08.01.00  decode_date_??: (yy < 70 ? 20yy : 19yy)        */ 
    644 /*    Version 4.2   07.09.98  No changes.                                    */ 
    645 /*    Version 4.1   08.06.98  Fixed bug in "add_delta_ymd()".                */ 
    646 /*    Version 4.0   12.05.98  Major rework. Added multi-language support.    */ 
    647 /*    Version 3.2   15.06.97  Added "week_of_year()".                        */ 
    648 /*    Version 3.1   12.06.97  No significant changes.                        */ 
    649 /*    Version 3.0   16.02.97  Changed conventions for unsuccessful returns.  */ 
    650 /*    Version 2.3   22.11.96  Fixed unbalanced "malloc" and "free".          */ 
    651 /*    Version 2.2   26.05.96  No significant changes.                        */ 
    652 /*    Version 2.1   26.05.96  Fixed HH MM SS parameter checks.               */ 
    653 /*    Version 2.0   25.05.96  Added time calculations. Major rework.         */ 
    654 /*    Version 1.6   20.04.96  Not published.                                 */ 
    655 /*    Version 1.5   14.03.96  No significant changes.                        */ 
    656 /*    Version 1.4   11.02.96  No significant changes.                        */ 
    657 /*    Version 1.3   10.12.95  Added "days_in_month()".                       */ 
    658 /*    Version 1.2b  27.11.95  No significant changes.                        */ 
    659 /*    Version 1.2a  21.11.95  Fix for type name clashes.                     */ 
    660 /*    Version 1.1   18.11.95  Fix for type name clashes.                     */ 
    661 /*    Version 1.01  16.11.95  Improved compliance w/ programming standards.  */ 
    662 /*    Version 1.0   14.11.95  First version under UNIX (with Perl module).   */ 
    663 /*    Version 0.9   01.11.93  First version of C library under MS-DOS.       */ 
     655/*    Version 5.4  03.10.04  Added compiler directives for C++.              */ 
     656/*    Version 5.3  29.09.02  No changes.                                     */