home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / UDEL.ZIP / SFDT.H < prev    next >
Text File  |  1988-08-13  |  12KB  |  267 lines

  1. /*****************************************************************************
  2. *  sfdt.h  standart date / time function protypes                            *
  3. *                                                 last change 01/23/88       *
  4. *****************************************************************************/
  5.  
  6.  
  7.  
  8.  
  9. struct dydif {
  10.                int  year;               /* year differance */
  11.                int  days;               /* + days difference */
  12.                long days_only;          /* days only */
  13.              };
  14.  
  15.  
  16.  
  17. void sfdt_get_c_time(char *);
  18. /****************************************************************************
  19. * get time and return in unformated 7 byte string.  (hour,minute,second)    *
  20. ****************************************************************************/
  21.  
  22.  
  23.  
  24. void sfdt_get_c_timeh(char *);
  25. /****************************************************************************
  26. * get time place return in unformated 9 byte string. (hour,minute,seconds,  *
  27. *                                                     hundreds)             *
  28. ****************************************************************************/
  29.  
  30.  
  31.  
  32.  
  33. void sfdt_get_fc_time(char *);
  34. /*****************************************************************************
  35. * get time place result in formated 9 byte string. (hr:mi:se format)         *
  36. *****************************************************************************/
  37.  
  38.  
  39.  
  40. void sfdt_get_fc_timeh(char *);
  41. /****************************************************************************
  42. * get time place result in formated 12 byte string. (hh:mi:se:hs format)    *
  43. *                                       hour,minute,seconds,hundred seconds *
  44. ****************************************************************************/
  45.  
  46.  
  47. void sfdt_get_fc_time12(char *);
  48. /****************************************************************************
  49. * get time place result in 12 byte string.  12 hour format with AM PM       *
  50. *                                           indicator.                      *
  51. ****************************************************************************/
  52.  
  53.  
  54.  
  55. long sfdt_get_l_time(void);
  56. /****************************************************************************
  57. *  returns long integer of current time.                                    *
  58. *                    format hours:minutes:seconds:hund sec                  *
  59. *                                                                           *
  60. *    example current time 12:05:05.06 will retunn long integer 12050506     *
  61. ****************************************************************************/
  62.  
  63.  
  64.  
  65. long sfdt_comp_diff_l_time(long,long);
  66. /*****************************************************************************
  67. *  computes time time difference between long time1, and long time2          *
  68. *           returns long time.                                               *
  69. *****************************************************************************/
  70.  
  71.  
  72.  
  73. void sfdt_comp_diff_st_time(struct dostime_t *,struct dostime_t *,struct dostime_t *);
  74. /*****************************************************************************
  75. * compute the time difference of struct tfrom structure time tto and returns *
  76. *         value in structure tdif                                            *
  77. *****************************************************************************/
  78.  
  79.  
  80.  
  81. void sfdt_get_c_date(char *,char *);
  82. /****************************************************************************
  83. *  get date place in 7 byte unformated string. format command.              *
  84. *                                                                           *
  85. *                                                                           *
  86. *       (date,format)                                                       *
  87. *                     formats  are M = month,day,year                       *
  88. *                                 Y = year,month day                        *
  89. ****************************************************************************/
  90.  
  91.  
  92.  
  93. void sfdt_get_fc_date(char *,char *);
  94. /****************************************************************************
  95. *  get formated date and place in 9 byte string.                            *
  96. *                                                                           *
  97. *                                                                           *
  98. *       (date,format)                                                       *
  99. *                     formats  are M = month,day,year                       *
  100. *                                 Y = year,month day                        *
  101. ****************************************************************************/
  102.  
  103.  
  104.  
  105. long sfdt_get_l_date();
  106. /****************************************************************************
  107. * get date and return long integer.  Format year, month, day                *
  108. *  example 03/03/87    will return 870303                                   *
  109. ****************************************************************************/
  110.  
  111.  
  112.  
  113. void sfdt_conv_fctoc(char *,char *);
  114. /****************************************************************************
  115. * convert formated character string time/date to unformated string.         *
  116. *                            (9byte,7byte)                                  *
  117. ****************************************************************************/
  118.  
  119.  
  120.  
  121.  
  122. void sfdt_conv_l_time_to_st(long,struct dostime_t *);
  123. /*****************************************************************************
  124. *   converts long time (tin) to structure time (tout)                        *
  125. *****************************************************************************/
  126.  
  127.  
  128.  
  129. long sfdt_conv_st_time_to_l(struct dostime_t *);
  130. /*****************************************************************************
  131. * connvert structure time (tin) returns a long time variable.                *
  132. *  formate HHmmsshh.   HH=hours, mm = minutes, ss=seconds, hh = hundreds     *
  133. *****************************************************************************/
  134.  
  135.  
  136.  
  137. void sfdt_conv_l_date_to_st(long,struct dosdate_t *);
  138. /*****************************************************************************
  139. *   converts long time (tin) to structure time (tout)                        *
  140. *****************************************************************************/
  141.  
  142.  
  143.  
  144. long sfdt_conv_st_date_to_l(struct dosdate_t *);
  145. /*****************************************************************************
  146. * converts structure date (din) and returns long date.                       *
  147. *****************************************************************************/
  148.  
  149.  
  150.  
  151.  
  152. void sfdt_conv_ctofc(char *,char *,char *);
  153. /*****************************************************************************
  154. * convert unformated to formated charter string with edit character f.       *
  155. *                                                                            *
  156. *   (uformated,formated,edit character                                       *
  157. *       7 byte  9 byte    1 byte                                             *
  158. * example sfdt_ctofc("010387",fc,"/")   returns fc value "01/03/87"          *  *
  159. *****************************************************************************/
  160.  
  161.  
  162.  
  163. void sfdt_conv_fc_date_ytom_fc(char *, char *);
  164. /****************************************************************************
  165. * convert formated date in year/month/day format to month/day/year  format  *
  166. *     (mdy,ymd)                                                             *
  167. ****************************************************************************/
  168.  
  169.  
  170. void sfdt_conv_fc_date_mtoy_fc(char *, char *);
  171. /****************************************************************************
  172. * convert formated date in month/day/year format to year/month/day  format  *
  173. *     (mdy,ymd)                                                             *
  174. ****************************************************************************/
  175.  
  176.  
  177.  
  178. void sfdt_conv_c_date_ytom_c(char *, char *);
  179. /****************************************************************************
  180. * convert unformated string (ymd) to unformated string (mdy)                *
  181. ****************************************************************************/
  182.  
  183.  
  184.  
  185. void sfdt_conv_c_date_mtoy_c(char *, char *);
  186. /*****************************************************************************
  187. *  convert unformated charter (mdy) to unformated (ymd)                      *
  188. *****************************************************************************/
  189.  
  190.  
  191.  
  192. long sfdt_conv_c_date_to_l(char *,char *);
  193. /****************************************************************************
  194. *  convert unformated character date in formate to long integer year,month  *
  195. *                                                               day.        *
  196. ****************************************************************************/
  197.  
  198.  
  199.  
  200. long sfdt_conv_fc_date_to_l(char *,char *);
  201. /****************************************************************************
  202. * convert formate character date in format to long integer year month day   *
  203. *                                                                           *
  204. ****************************************************************************/
  205.  
  206.  
  207.  
  208. void sfdt_conv_l_date_to_c(long,char *, char *);
  209. /****************************************************************************
  210. * convert long integer date to unformate char date in fomrat                *
  211. ****************************************************************************/
  212.  
  213.  
  214.  
  215. int sfdt_validate_c_date(char *,char *);
  216. /**************************************************************************
  217. *  validate unformated character date, in format y=year month day         *
  218. *                                                m=month day year         *
  219. **************************************************************************
  220.  
  221.  
  222.  
  223. int sfdt_validate_fc_date(char *,char *);
  224. /****************************************************************************
  225. * validate formated date in formate given                                   *
  226. ****************************************************************************/
  227.  
  228.  
  229.  
  230. int sfdt_validate_l_date(long);
  231. /****************************************************************************
  232. * validate long date                                                        *
  233. ****************************************************************************/
  234.  
  235.  
  236.  
  237. void sfdt_comp_diff_st_date(struct dosdate_t *,struct dosdate_t *,struct dydif *);
  238. /*****************************************************************************
  239. * returns to diffrence of structure date1,date2 in structure diff.           *
  240. *****************************************************************************/
  241.  
  242.  
  243.  
  244.  
  245. void sfdt_comp_diff_l_date(long,long,struct dydif *);
  246. /*****************************************************************************
  247. * computes of diffrence between long date1,date2 return structure diff       *
  248. *****************************************************************************/
  249.  
  250.  
  251.  
  252. void sfdt_wait_interval(long);
  253. /*****************************************************************************
  254. *   wait and return after time interval      formate of input HHmmsshh       *
  255. *        has expired.                        where HH = hour    mm = minutes *
  256. *                                                  ss = seconds hh = hund sec*
  257. *****************************************************************************/
  258.  
  259.  
  260.  
  261. void sfdt_wait_time(long);
  262. /*****************************************************************************
  263. *   wait and return after time               formate of input HHmmsshh       *
  264. *        has expired.                        where HH = hour    mm = minutes *
  265. *                                                  ss = seconds hh = hund sec*
  266. *****************************************************************************/
  267.