summaryrefslogtreecommitdiffstats
path: root/lib/libcalendar/calendar.3
diff options
context:
space:
mode:
authorhelbig <helbig@FreeBSD.org>1997-12-13 11:51:16 +0000
committerhelbig <helbig@FreeBSD.org>1997-12-13 11:51:16 +0000
commitb1f57417ba98aa37c66d2590e22b8c523dfb98c6 (patch)
treee3235b9cf36a51ba71a5df4a659e2b9ad1db2858 /lib/libcalendar/calendar.3
parent6d4edda5c2691c4a14dc4540eb2a9468dcf04fd2 (diff)
downloadFreeBSD-src-b1f57417ba98aa37c66d2590e22b8c523dfb98c6.zip
FreeBSD-src-b1f57417ba98aa37c66d2590e22b8c523dfb98c6.tar.gz
Delete "typedef ... date" (see style(9)).
In the man page Use ".Pp" instead of blank lines, adopt English and stress that the Julian->Gregorian switch took place at different dates in different countries. Suggested by: Garrett.
Diffstat (limited to 'lib/libcalendar/calendar.3')
-rw-r--r--lib/libcalendar/calendar.362
1 files changed, 33 insertions, 29 deletions
diff --git a/lib/libcalendar/calendar.3 b/lib/libcalendar/calendar.3
index 0ac6544..bbf5ede 100644
--- a/lib/libcalendar/calendar.3
+++ b/lib/libcalendar/calendar.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: calendar.3,v 1.1.1.1 1997/12/04 10:41:49 helbig Exp $
+.\" $Id: calendar.3,v 1.2 1997/12/07 19:04:08 helbig Exp $
.\"
.Dd November 29, 1997
.Dt CALENDAR 3
@@ -40,20 +40,20 @@
.Nd Calendar arithmetic for the Christian era.
.Sh SYNOPSIS
.Fd #include <calendar.h>
-.Ft date *
-.Fn easterg "int year" "date *dt"
-.Ft date *
-.Fn easterog "int year" "date *dt"
-.Ft date *
-.Fn easteroj "int year" "date *dt"
-.Ft date *
-.Fn gdate "int nd" "date *dt"
-.Ft date *
-.Fn jdate "int nd" "date *dt"
+.Ft struct date *
+.Fn easterg "int year" "struct date *dt"
+.Ft struct date *
+.Fn easterog "int year" "struct date *dt"
+.Ft struct date *
+.Fn easteroj "int year" "struct date *dt"
+.Ft struct date *
+.Fn gdate "int nd" "struct date *dt"
+.Ft struct date *
+.Fn jdate "int nd" "struct date *dt"
.Ft int
-.Fn ndaysg "date *dt"
+.Fn ndaysg "struct date *dt"
.Ft int
-.Fn ndaysj "date *dt"
+.Fn ndaysj "struct date *dt"
.Ft int
.Fn week "int nd" "int *year"
.Ft int
@@ -62,10 +62,10 @@
These functions provide calendar arithmetic for a large range of years,
starting at March 1st, year zero (i. e. 1 B.C.) and ending way beyond
year 100000.
-
+.Pp
Programs should be linked with
.Fl lcalendar .
-
+.Pp
The functions
.Fn easterg ,
.Fn easterog
@@ -89,7 +89,7 @@ The result returned by
is the date in Gregorian Calendar, whereas
.Fn easteroj
returns the date in Julian Calendar.
-
+.Pp
The functions
.Fn gdate ,
.Fn jdate ,
@@ -101,7 +101,7 @@ of a date and the "number of days" representation, which is better suited
for calculations. The days are numbered from March 1st year 1 B.C., starting
with zero, so the number of a day gives the number of days since March 1st,
year 1 B.C. The conversions work for nonnegative day numbers only.
-
+.Pp
The
.Fn gdate
and
@@ -112,7 +112,7 @@ store the date corresponding to the day number
into the structure pointed at by
.Fa dt
and return a pointer to this structure.
-
+.Pp
The
.Fn ndaysg
and
@@ -120,19 +120,19 @@ and
functions
return the day number of the date pointed at by
.Fa dt .
-
+.Pp
The
.Fn gdate
and
.Fn ndaysg
functions
-assume Gregorian Calendar after October 4th 1582 and Julian Calendar before,
+assume Gregorian Calendar after October 4, 1582 and Julian Calendar before,
whereas
.Fn jdate
and
.Fn ndaysj
assume Julian Calendar throughout.
-
+.Pp
The two calendars differ by the definition of the leap year. The
Julian Calendar says every year that is a multiple of four is a
leap year. The Gregorian Calendar excludes years that are multiples of
@@ -140,9 +140,13 @@ leap year. The Gregorian Calendar excludes years that are multiples of
This means the years 1700, 1800, 1900, 2100 are not leap years
and the year 2000 is
a leap year.
-The new rules were inaugurated on October 4th 1582 by deleting ten
-days following this date.
-
+The new rules were inaugurated on October 4, 1582 by deleting ten
+days following this date. Most catholic countries adopted the new
+calendar by the end of the 16th century, whereas others stayed with
+the Julian Calendar until the 20th century. The United Kingdom and
+their colonies switched on September 2, 1752. They already had to
+delete 11 days.
+.Pp
The function
.Fn week
returns the number of the week which contains the day numbered
@@ -154,15 +158,15 @@ The weeks are numbered per year starting with week 1, which is the
first week in a year that includes more than three days of the year.
Weeks start on Monday.
This function is defined for Gregorian Calendar only.
-
+.Pp
The function
.Fn weekday
returns the weekday (Mo = 0 .. Su = 6) of the day numbered
.Fa nd .
-
-The type
+.Pp
+The structure
.Fa date
-is a structure defined in
+is defined in
.Aq Pa calendar.h .
It contains these fields:
.Bd -literal -offset indent
@@ -170,7 +174,7 @@ int y; /\(** year (0000 - ????) \(**/
int m; /\(** month (1 - 12) \(**/
int d; /\(** day of month (1 - 31) \(**/
.Ed
-
+.Pp
The year zero is written as "1 B.C." by historians and "0" by astronomers
and in this library.
.Sh SEE ALSO
OpenPOWER on IntegriCloud