< previous page page_175 next page >

Page 175
Following the header files is a set of function prototypes for the routines used in the program. All but the two print utility functions would normally appear in a separate header file, which would prototype the functions for the particular country and application.
The main () function is very simple. It prints a one-line report title then uses a simple for loop to call the code block executed for each year from A.D. 1995 to 2000. The block is likewise simple, consisting of a utility print function and holiday_netherlands () function.
The next task is to define holiday_netherlands (). The first requirement is a current list of holidays for the Netherlands. According to Thompson and Carlson (Holidays, Festivals, and Celebrations of the World Dictionary), these are:
New Year, defined as 1 January.
Good Friday, defined as the Friday before Easter Sunday.
Easter Monday, defined as the Monday after Easter Sunday.
Queen's Birthday, defined as 30 April.
Liberation Day, defined as 5 May in years evenly divisible by 5.
Ascension Day, defined as 40 days after Easter Sunday.
Whit-Monday, defined as the Monday after Whit-Sunday.
Christmas, defined as 25 December.
Boxing Day, defined as 26 December.
The first immediate problem is the definition of "holiday." The third Tuesday in September is called "Prinsjesdag", and marks the day when the Queen reads the Throne Speech. This is a holiday, but only for schools and certain governmental departments in the Hague. SCDTL contributors who live in the Netherlands, on the other hand, deny that Good Friday is a general holiday in that country altogether.
The take-home lesson, of course, is that any real application must first determine the actual holidays currently observed, the actual rules for their definition, and a definition of "holiday" for the purposes of the application.
Here, I shall add Prinsjesdag to the nine days of the list, giving a total of 10 days for the purpose of the example.
The holiday_netherlands () routine may then be defined in the following way. First, for an application for a given country, a header file containing the function prototypes for the various holiday functions would be useful. Such a file as netherl1.h could be defined, with the following contents:

 
< previous page page_175 next page >