|
|
1.1 root 1: /* datewrap.h */
2:
1.1.1.2 ! root 3: /* Wrappers for non-standard date and time functions */
1.1 root 4:
1.1.1.2 ! root 5: /* $Id: datewrap.h,v 1.21 2008/02/23 22:18:37 rswindell Exp $ */
1.1 root 6:
7: /****************************************************************************
8: * @format.tab-size 4 (Plain Text/Source Code File Header) *
9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
10: * *
1.1.1.2 ! root 11: * Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
1.1 root 12: * *
13: * This library is free software; you can redistribute it and/or *
14: * modify it under the terms of the GNU Lesser General Public License *
15: * as published by the Free Software Foundation; either version 2 *
16: * of the License, or (at your option) any later version. *
17: * See the GNU Lesser General Public License for more details: lgpl.txt or *
18: * http://www.fsf.org/copyleft/lesser.html *
19: * *
20: * Anonymous FTP access to the most recent released source is available at *
21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
22: * *
23: * Anonymous CVS access to the development source and modification history *
24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: *
25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login *
26: * (just hit return, no password is necessary) *
27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src *
28: * *
29: * For Synchronet coding style and modification guidelines, see *
30: * http://www.synchro.net/source.html *
31: * *
32: * You are encouraged to submit any modifications (preferably in Unix diff *
33: * format) via e-mail to [email protected] *
34: * *
35: * Note: If this box doesn't appear square, then you need to fix your tabs. *
36: ****************************************************************************/
37:
38: #ifndef _DATEWRAP_H_
39: #define _DATEWRAP_H_
40:
41: #include "genwrap.h" /* time_t */
42:
1.1.1.2 ! root 43: #if defined(__cplusplus)
! 44: extern "C" {
! 45: #endif
! 46:
! 47: /* Return difference (in seconds) in time() result from standard (0 on success) */
! 48: time_t checktime(void);
! 49:
! 50: /* Implementation of mktime() that handles common tm element conversions for you */
! 51: time_t sane_mktime(struct tm* tm);
1.1 root 52:
1.1.1.2 ! root 53: /*********************************************************************************/
! 54: /* Win32 implementations of recursive (thread-safe) std C time functions on Unix */
! 55: /*********************************************************************************/
1.1 root 56:
1.1.1.2 ! root 57: #if !defined(__unix__)
1.1 root 58:
1.1.1.2 ! root 59: #include <time.h> /* time_t, etc. */
! 60:
! 61: DLLEXPORT struct tm* DLLCALL gmtime_r(const time_t* t, struct tm* tm);
! 62: DLLEXPORT struct tm* DLLCALL localtime_r(const time_t* t, struct tm* tm);
! 63: DLLEXPORT char* DLLCALL ctime_r(const time_t *t, char *buf);
! 64: DLLEXPORT char* DLLCALL asctime_r(const struct tm *tm, char *buf);
! 65: DLLEXPORT char* DLLCALL strtok_r(char *str, const char *delim, char **last);
! 66:
! 67: #endif
1.1 root 68:
69: /***********************************/
70: /* Borland DOS date/time functions */
71: /***********************************/
72:
73: #if defined(__BORLANDC__)
74:
75: #include <dos.h>
76:
77: #else
78:
79: struct date {
80: short da_year;
81: char da_day;
82: char da_mon;
83: };
84:
85: struct time {
86: unsigned char ti_min;
87: unsigned char ti_hour;
88: unsigned char ti_hund;
89: unsigned char ti_sec;
90: };
91:
92: #define getdate(x) xp_getdate(x)
93: void xp_getdate(struct date*);
94: void gettime(struct time*);
95:
1.1.1.2 ! root 96: #endif /* !Borland */
! 97:
1.1 root 98: #if defined(__cplusplus)
99: }
100: #endif
101:
102: #endif /* Don't add anything after this line */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.