home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / database / softc210 / headers / sc_clock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-08  |  7.8 KB  |  263 lines

  1. /*************************************************
  2.  **                                             **
  3.  **   sc_clock.h                                **
  4.  **                                             **
  5.  **     SoftC Clock/Calendar functions header   **
  6.  **                                             **
  7.  **          Copyright (C) 1989, 1990 by        **
  8.  **               SoftC, Ltd.                   **
  9.  **               16820 3rd St NE               **
  10.  **               Ham Lake, MN 55304            **
  11.  **               (612) 434-6968                **
  12.  **                                             **
  13.  **             All rights reserved.            **
  14.  *************************************************/
  15.  
  16.  
  17.  
  18. /**********
  19.  *
  20.  *  Defines
  21.  *
  22.  **********/
  23.  
  24.  
  25.  
  26.  
  27. #define SC_GREGOR 1         /* Gregorian date "mm/dd/yy" */
  28. #define SC_GREGORL 2        /* Gregorian date "mm/dd/yyyy" */
  29. #define SC_JULIAN 3         /* Julian date "yyyy/ddd" */
  30. #define SC_YMD 4            /* dBASE date "yyyymmdd" */
  31. #define SC_DMY 5            /* European Military date "ddmmyy" */
  32. #define SC_EURODATE 6       /* European date "dd.mm.yy" */
  33. #define SC_EURODATEL 7      /* European date "dd.mm.yyyy" */
  34.  
  35. #define SC_CSHMS 1          /* colon separated time "hh:mm:ss" */
  36. #define SC_MIL 2            /* Military time 0000 - 2359 */
  37.  
  38.  
  39.  
  40. /**********
  41.  *
  42.  *  Integer Date Source Function Prototypes
  43.  *
  44.  **********/
  45.  
  46.  
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. INT sccdi2l(    LONG *,           /* number of days since 1/1 0001 */
  53.                 INT,              /* year */
  54.                 INT,              /* month */
  55.                 INT );            /* day */
  56.  
  57. INT sccdi2s(    CHAR *,           /* date string */
  58.                 INT,              /* date string format (YMD, GREG, JUL) */
  59.                 INT,              /* year */
  60.                 INT,              /* month */
  61.                 INT );            /* day */
  62.  
  63. INT sccdiget(   INT *,            /* current DOS year */
  64.                 INT *,            /*             month */
  65.                 INT *,            /*             day of month */
  66.                 INT *);           /*             day of week */
  67.  
  68. INT sccdileap(  INT );            /* year */
  69.  
  70. INT sccdiperm(  CHAR *,           /* number of days in month */
  71.                 INT,              /* desired year */
  72.                 INT);             /* desired month */
  73.  
  74.  
  75.  
  76.  
  77. /**********
  78.  *
  79.  *  Long Date Source Function Prototypes
  80.  *
  81.  **********/
  82.  
  83.  
  84.  
  85.  
  86. INT sccdl2dow(  CHAR *,           /* day number (0-6) */
  87.                 LONG );           /* LONG date source */
  88.  
  89. INT sccdl2i(    INT *,            /* year */
  90.                 INT *,            /* month */
  91.                 INT *,            /* day */
  92.                 LONG );           /* LONG date source */
  93.  
  94. INT sccdl2sx(   CHAR *,           /* date string */
  95.                 INT,              /* date string format */
  96.                 LONG);            /* number of days since 1/1/00 */
  97.  
  98.  
  99.  
  100.  
  101. /**********
  102.  *
  103.  *  String Date Source Function Prototypes
  104.  *
  105.  **********/
  106.  
  107.  
  108.  
  109. INT sccds2day(  CHAR *,           /* day of week string */
  110.                 CHAR *,           /* source date string */
  111.                 INT );            /* source date string format */
  112.  
  113. INT sccds2dow(  CHAR *,           /* day of week number */
  114.                 CHAR *,           /* source date string */
  115.                 INT );            /* source date string format */
  116.  
  117. INT sccds2i(    INT *,            /* year */
  118.                 INT *,            /* month */
  119.                 INT *,            /* day */
  120.                 CHAR *,           /* date string */
  121.                 INT );            /* string format */
  122.  
  123. INT sccds2lx(   LONG *,           /* number of days since 1/1 0001 */
  124.                 CHAR *,           /* date string */
  125.                 INT );            /* date string format (YMD,GREG, JUL) */
  126.  
  127. INT sccds2mon(  CHAR *,           /* month of year string */
  128.                 CHAR *,           /* source date string */
  129.                 INT );            /* source date string format */
  130.  
  131. INT sccds2s(    CHAR *,           /* output date string */
  132.                 INT,              /* output string format */
  133.                 CHAR *,           /* source date string */
  134.                 INT );            /* source string format */
  135.  
  136. INT sccdsday(   CHAR *,           /* day of week text string */
  137.                 CHAR);            /* numeric day of week */
  138.  
  139. INT sccdsdiff(  LONG *,           /* difference in days */
  140.                 CHAR *,           /* date string */
  141.                 INT,              /* string format (YMD, GREG, JULIAN) */
  142.                 CHAR *,           /* date string */
  143.                 INT);             /* string format (YMD, GREG, JULIAN) */
  144.  
  145. INT sccdsget(   CHAR *,           /* DOS date string */
  146.                 INT );            /* date string format */
  147.  
  148. INT sccdsleap(  CHAR *,           /* date string */
  149.                 INT );            /* string format (YMD,GREG,JULIAN) */
  150.  
  151. INT sccdsmonth( CHAR *,           /* month text string */
  152.                 CHAR);            /* numeric month */
  153.  
  154. INT sccdsperm(  CHAR *,           /* number of days in month */
  155.                 CHAR *,           /* date string */
  156.                 INT );            /* string format (YMD, GREG, JUL) */
  157.  
  158. INT sccdsvalid( CHAR *,           /* date string */
  159.                 INT );            /* string format (YMD,GREG,JULIAN) */
  160.  
  161.  
  162.  
  163.  
  164.  
  165. /**********
  166.  *
  167.  *  Integer Clock Source Function Prototypes
  168.  *
  169.  **********/
  170.  
  171.  
  172.  
  173.  
  174. INT sccti2s(    CHAR *,           /* time string */
  175.                 INT,              /* string format (H:M:S) */
  176.                 INT,              /* hours */
  177.                 INT,              /* minutes */
  178.                 INT);             /* seconds */
  179.  
  180. INT scctiget(   INT *,            /* current DOS hour */
  181.                 INT *,            /*             minute */
  182.                 INT *,            /*             second */
  183.                 INT * );          /*             hundredths of second */
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. /**********
  191.  *
  192.  *  String Clock Source Function Prototypes
  193.  *
  194.  **********/
  195.  
  196.  
  197.  
  198.  
  199. INT sccts2i(    INT *,            /* hours */
  200.                 INT *,            /* minutes */
  201.                 INT *,            /* seconds */
  202.                 CHAR *,           /* time string */
  203.                 INT);             /* string format (H:M:S) */
  204.  
  205. INT scctsdiff(  LONG *,           /* number of seconds difference */
  206.                 CHAR *,           /* time 1 */
  207.                 INT,              /* string format */
  208.                 CHAR *,           /* time 2 */
  209.                 INT);             /* string format (H:M:S) */
  210.  
  211. INT scctsget(   CHAR *,           /* current time in string format */
  212.                 INT);             /* time string format (MIL, H:M:S) */
  213.  
  214. INT scctsvalid( CHAR *,           /* time string */
  215.                 INT);             /* string format (H:M:S) */
  216. #ifdef __cplusplus
  217. }
  218. #endif
  219.  
  220.  
  221.  
  222.  
  223. /**********
  224.  *
  225.  *  External Variables
  226.  *
  227.  **********/
  228.  
  229.  
  230.  
  231.  
  232. extern CHAR sc_dpm[13];    /* days per month array */
  233.  
  234.  
  235.  
  236. /**********
  237.  *
  238.  *  Compatibility Definitions
  239.  *
  240.  **********/
  241.  
  242.  
  243.  
  244.  
  245. #define sccday(a,b) sccdsday(a,b)
  246. #define sccddiff(a,b,c) sccdsdiff(a,b,SC_YMD,c,SC_YMD)
  247. #define sccdl2s(a,b) sccdl2sx(a,SC_YMD,b)
  248. #define sccdn2s(a,b,c,d) sccdi2s(a,SC_YMD,b,c,d)
  249. #define sccdperm(a,b) sccdsperm(a,b,SC_YMD)
  250. #define sccdpermi(a,b,c) sccdiperm(a,b,c)
  251. #define sccds2l(a,b) sccds2lx(a,b,SC_YMD)
  252. #define sccds2n(a,b,c,d) sccds2i(a,b,c,d,SC_YMD)
  253. #define sccdvalid(a) sccdsvalid(a,SC_YMD)
  254. #define sccleap(a) sccdsleap(a,SC_YMD)
  255. #define sccleapi(a) sccdileap(a)
  256. #define sccmonth(a,b) sccdsmonth(a,b)
  257.  
  258. #define scctdiff(a,b,c) scctsdiff(a,b,SC_CSHMS,c,SC_CSHMS)
  259. #define scctn2s(a,b,c,d) sccti2s(a,SC_CSHMS,b,c,d)
  260. #define sccts2n(a,b,c,d) sccts2i(a,b,c,d,SC_CSHMS)
  261. #define scctvalid(a) scctsvalid(a,SC_CSHMS)
  262.  
  263.