home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
j
/
julian11.zip
/
JULIAN.DOC
< prev
next >
Wrap
Text File
|
1993-01-11
|
6KB
|
165 lines
JULIAN Library
Version 1.10
By
D. M. Hurst & Associates
8912 Spur Road
Springfield, Virginia 22153
This library is placed in the public domain by the author.
As a courtesy, please give author credit in all program
documentation.
DESCRIPTION
JULIAN.H must be included with your source and JULIANL.LIB or
JULIANS.LIB (depending on the memory model you are using) must be
linked with your other object modules and libraries. If you need
other memory models, source and make files are included for
generating these models for both MSC 5.1/6.00A and Borlandc C/C++
2.0/3.0/3.1. JULIAN.H also defines DAY_SECS as 86400L, the
number of seconds in a 24 hour day... as opposed to other types
of days you may be used to dealing with.
LIBRARY FUNCTIONS
JULIAN is a small library that allows date manipulation and
arithmetic. It consists of the following functions:
1. time_t date_to_jul(char *date_stp,char *format_stp);
Takes a string date "date_stp" in the format "format_stp" and
returns a julian date. The format string "format_stp" can be any
one of the following:
YY/MM/DD MM/DD/YY YYMMDD MMDDYY YYYYMMDD
2. int date_fm_jul(char *dateret_stp,
time_t juldate,
char *format_stp);
Converts a julian date "juldate" to a string date "dateret_stp"
using the format "format_stp". Fomats are the same as those
described in 1. above. The string date "dateret_stp" must be
allocated to sufficient length prior to calling this function.
3. time_t date_diff(char *date1_stp,
char *date2_stp,
char *format_stp);
Computes the difference, in days, between two string dates,
"date1_stp" and "date2_stp", using the format "format_stp". Both
strings must be in the format "format_stp" as described in 1.
above. If "date1_stp" is greater than "date2_stp", the result
will be a negative number. Normally "date2_stp" is the larger
date.
4. int date_plus(char *dateret_stp,
char *date_stp,
char *format_stp,
time_t days);
Adds a number of days to a string date "date_stp". The string
date must be in the format "format_stp" as discribed in 1. above.
The new date will be stored in "dateret_stp" which must be
allocated to sufficient length.
5. int isleapyear(int year);
Simply returns 1 if "year" is a leap year and 0 if it is not.
THE FILES
JULIAN BCC 87 01-11-93 11:59p
TLIB response file for building Borland compatible
libraries
DATEDIFF C 562 01-11-93 11:59p
See description above
DATEJFM C 1894 01-11-93 11:59p
See description above
DATEJTO C 2249 01-11-93 11:59p
See description above
DATEPLUS C 646 01-11-93 11:59p
See description above
ISLEAP C 108 01-11-93 11:59p
See description above
JULTEST C 1328 01-11-93 11:59p
Source for the program which tests JULIAN's functionality
JULIAN DOC 3074 01-11-93 11:59p
This document
JULTEST EXE 12695 01-11-93 11:59p
Compiled with MSC (MAKE JULTESTM.MAK)
JULTESTB EXE 17342 01-11-93 11:59p
Compiled with Borland C (TMAKE -FJULTESTB.MAK)
JULIAN H 547 01-11-93 11:59p
JULIAN's header file
BULIANL LIB 5632 01-11-93 11:59p
Borland large code library
BULIANS LIB 5120 01-11-93 11:59p
Borland small code library
MULIANL LIB 4141 01-11-93 11:59p
Microsoft large code library
MULIANS LIB 4141 01-11-93 11:59p
Microsoft small code library
JULTEST LNK 40 01-11-93 11:59p
Microsoft link file for JULIAN's test program
JULIANB MAK 477 01-11-93 11:59p
Make file for building Borland libraries
JULIANM MAK 465 01-11-93 11:59p
Make file for building Microsoft Libraies
JULTESTB MAK 828 01-11-93 11:59p
Make file produced from JULTESTB.PRJ using PRJ2MAK
JULTESTM MAK 100 01-11-93 11:59p
Make file for compiling JULIAN's test program with
Microsoft C
JULIAN MSC 90 01-11-93 11:59p
LIB response file for building Microsoft compatible
libraries
JULTESTB PRJ 5190 01-11-93 11:59p
Borland project file for JULIAN's test program
FILES NOTES:
1. You will almost certainly have to modify the Borland .PRJ
and/or .MAK files to match your include and library directories.
2. The combination of JULIANB.MAK and JULIAN.BCC produce
JULIAN?.LIB. You have to modify JULIANB.MAK to reflect
the correct memory model.
3. The combination of JULIANM.MAK and JULIAN.MSC also
produce JULIAN?.LIB. You have to modify JULIANM.MAK to
reflect the correct memory model.
4. Since the library make and response files for both
Borland and Microsoft produce JULIAN?.LIB, the libraries
supplied have been renamed BULIANS.LIB and BULIANL.LIB for
Borland and MULIANS.LIB and MULIANL.LIB for Microsoft.
POSSIBLE ENHANCEMENTS
If you routinely work with string dates that are of dissimilar
formats (e.g. one date is MM/DD/YY and the other is YYYYMMDD),
you may want to modify date_diff and date_plus to work with
string date parameters of differing formats... now why didn't
I think of that.
Doug Hurst