< previous page page_69 next page >

Page 69
(continued)
Listing 4.9
   5. "scdtl_5.h", prototypes of functions for date and time comparisons.
   6. "scdtl_6.h", prototypes of functions for proleptic calendar
                   applications.
   7. "scdtl_7.h", definitions, data structures and function prototypes
                   for date/time stamping and compression applications.
*/
#ifndef __SCDTL_7_H
#define __SCDTL_7_H


#include "dateinfo.h"
#include "timeinfo.h"


/* Definitions */
/*
   The PACK_DATE_YEAR is the year which begins the local epoch for the
   application system, with respect to packed dates. The year of a packed
   date is preserved as an offset 'n', from the year PACK_DATE_YEAR, where
   0 <= n <= 127.


   The value of PACK_DATE_YEAR should be less than or equal to the value
   of the smallest year used in the application of use. The value of the
   largest year used in the application should not exceed the value of
   PACK_DATE_YEAR + 127.


   The date packing scheme implicitly assumes the use of the Western
   (Julian / Gregorian) calendar system.


   The SCDTL system is issued with PACK_DATE_YEAR set to a default value
   of '1990'. The user can change this value.
*/
#define PACK_DATE_YEAR 1990


/* Function prototypes */
extern int date_to_day_number (struct DATE_INFO *date);
extern int date_to_int (struct DATE_INFO *date);
extern long date_to_long (struct DATE_INFO *date);
extern struct DATE_INFO day_number_to_date (int year, int day);
extern struct DATE_INFO int_to_date (int pack);
extern struct TIME_INFO int_to_time int pack);
extern struct DATE_INFO long_to_date (long stamp);
extern struct TIME_INFO long_to_time (long stamp);
extern int time_to_int (struct TIME_INFO *time);
extern long time_to_long (struct TIME_INFO *time);


#endif

 
< previous page page_69 next page >