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 >
Text File  |  1993-01-11  |  6KB  |  165 lines

  1.                             JULIAN Library
  2.  
  3.                              Version 1.10
  4.  
  5.                                  By 
  6.  
  7.                        D. M. Hurst & Associates
  8.                             8912 Spur Road
  9.                      Springfield, Virginia 22153
  10.  
  11.  
  12. This library is placed in the public domain by the author.  
  13. As a courtesy, please give author credit in all program 
  14. documentation.
  15.  
  16.  
  17.                            DESCRIPTION
  18.  
  19. JULIAN.H must be included with your source and JULIANL.LIB or 
  20. JULIANS.LIB (depending on the memory model you are using) must be 
  21. linked with your other object modules and libraries.  If you need 
  22. other memory models, source and make files are included for 
  23. generating these models for both MSC 5.1/6.00A and Borlandc C/C++ 
  24. 2.0/3.0/3.1.  JULIAN.H also defines DAY_SECS as 86400L, the 
  25. number of seconds in a 24 hour day... as opposed to other types 
  26. of days you may be used to dealing with.
  27.  
  28.  
  29.                           LIBRARY FUNCTIONS
  30.  
  31. JULIAN is a small library that allows date manipulation and 
  32. arithmetic.  It consists of the following functions:
  33.  
  34.  
  35.     1.  time_t date_to_jul(char *date_stp,char *format_stp);
  36.        
  37. Takes a string date "date_stp" in the format "format_stp" and 
  38. returns a julian date.  The format string "format_stp" can be any 
  39. one of the following:
  40.  
  41.         YY/MM/DD   MM/DD/YY   YYMMDD   MMDDYY   YYYYMMDD
  42.  
  43.  
  44.     2.  int date_fm_jul(char *dateret_stp,
  45.                         time_t juldate, 
  46.                         char *format_stp);
  47.  
  48. Converts a julian date "juldate" to a string date "dateret_stp" 
  49. using the format "format_stp".  Fomats are the same as those 
  50. described in 1. above.  The string date "dateret_stp" must be 
  51. allocated to sufficient length prior to calling this function.
  52.  
  53.  
  54.     3.  time_t date_diff(char *date1_stp, 
  55.                          char *date2_stp, 
  56.                          char *format_stp);
  57.  
  58. Computes the difference, in days, between two string dates, 
  59. "date1_stp" and "date2_stp", using the format "format_stp".  Both 
  60. strings must be in the format "format_stp" as described in 1. 
  61. above.  If "date1_stp" is greater than "date2_stp", the result 
  62. will be a negative number.  Normally "date2_stp" is the larger 
  63. date.
  64.  
  65.  
  66.     4.  int date_plus(char *dateret_stp,
  67.                       char *date_stp,
  68.                       char *format_stp,
  69.                       time_t days);
  70.  
  71. Adds a number of days to a string date "date_stp".  The string 
  72. date must be in the format "format_stp" as discribed in 1. above.
  73. The new date will be stored in "dateret_stp" which must be 
  74. allocated to sufficient length.
  75.  
  76.  
  77.     5.  int isleapyear(int year);
  78.  
  79. Simply returns 1 if "year" is a leap year and 0 if it is not.
  80.  
  81.  
  82.                             THE FILES
  83.  
  84.  
  85. JULIAN   BCC        87 01-11-93  11:59p
  86.   TLIB response file for building Borland compatible 
  87.   libraries
  88. DATEDIFF C         562 01-11-93  11:59p
  89.   See description above
  90. DATEJFM  C        1894 01-11-93  11:59p
  91.   See description above
  92. DATEJTO  C        2249 01-11-93  11:59p
  93.   See description above
  94. DATEPLUS C         646 01-11-93  11:59p
  95.   See description above
  96. ISLEAP   C         108 01-11-93  11:59p
  97.   See description above
  98. JULTEST  C        1328 01-11-93  11:59p
  99.   Source for the program which tests JULIAN's functionality
  100. JULIAN   DOC      3074 01-11-93  11:59p
  101.   This document
  102. JULTEST  EXE     12695 01-11-93  11:59p
  103.   Compiled with MSC (MAKE JULTESTM.MAK)
  104. JULTESTB EXE     17342 01-11-93  11:59p
  105.   Compiled with Borland C (TMAKE -FJULTESTB.MAK)
  106. JULIAN   H         547 01-11-93  11:59p
  107.   JULIAN's header file
  108. BULIANL  LIB      5632 01-11-93  11:59p
  109.   Borland large code library
  110. BULIANS  LIB      5120 01-11-93  11:59p
  111.   Borland small code library
  112. MULIANL  LIB      4141 01-11-93  11:59p
  113.   Microsoft large code library
  114. MULIANS  LIB      4141 01-11-93  11:59p
  115.   Microsoft small code library
  116. JULTEST  LNK        40 01-11-93  11:59p
  117.   Microsoft link file for JULIAN's test program
  118. JULIANB  MAK       477 01-11-93  11:59p
  119.   Make file for building Borland libraries
  120. JULIANM  MAK       465 01-11-93  11:59p
  121.   Make file for building Microsoft Libraies
  122. JULTESTB MAK       828 01-11-93  11:59p
  123.   Make file produced from JULTESTB.PRJ using PRJ2MAK
  124. JULTESTM MAK       100 01-11-93  11:59p
  125.   Make file for compiling JULIAN's test program with 
  126.   Microsoft C
  127. JULIAN   MSC        90 01-11-93  11:59p
  128.   LIB response file for building Microsoft compatible 
  129.   libraries
  130. JULTESTB PRJ      5190 01-11-93  11:59p
  131.   Borland project file for JULIAN's test program
  132.  
  133. FILES NOTES:
  134.  
  135. 1.  You will almost certainly have to modify the Borland .PRJ 
  136. and/or .MAK files to match your include and library directories.
  137.  
  138. 2.  The combination of JULIANB.MAK and JULIAN.BCC produce
  139. JULIAN?.LIB.  You have to modify JULIANB.MAK to reflect
  140. the correct memory model.
  141.  
  142. 3.  The combination of JULIANM.MAK and JULIAN.MSC also 
  143. produce JULIAN?.LIB.  You have to modify JULIANM.MAK to 
  144. reflect the correct memory model.
  145.  
  146. 4.  Since the library make and response files for both 
  147. Borland and Microsoft produce JULIAN?.LIB, the libraries
  148. supplied have been renamed BULIANS.LIB and BULIANL.LIB for
  149. Borland and MULIANS.LIB and MULIANL.LIB for Microsoft.
  150.  
  151.  
  152.  
  153.                       POSSIBLE ENHANCEMENTS
  154.  
  155. If you routinely work with string dates that are of dissimilar 
  156. formats (e.g. one date is MM/DD/YY and the other is YYYYMMDD), 
  157. you may want to modify date_diff and date_plus to work with 
  158. string date parameters of differing formats... now why didn't
  159. I think of that.
  160.  
  161.  
  162.  
  163. Doug Hurst
  164.  
  165.