1 /*
2  * Copyright (C) 1999 Uwe Ohse
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  * As a special exception this source may be used as part of the
19  * SRS project by CORE/Computer Service Langenbach
20  * regardless of the copyright they choose.
21  *
22  * Contact: uwe@ohse.de
23  */
24 #ifndef UOTIME_H
25 #define UOTIME_H
26 
27 /* this is frustration: why can't vendors provide usable time header files, damned? */
28 
29 typedef unsigned long uo_sec70_t; /* secs since 1970 */
30 typedef struct {
31 	long year;
32 	short mon; /* 0..11 */
33 	short day; /* 1..31 */
34 	short hour;
35 	short min;
36 	short sec;
37 } uo_datetime_t;
38 
39 uo_sec70_t uo_now(void);
40 uo_sec70_t uo_dt2sec70 (uo_datetime_t *tm);
41 int uo_sec702dt(uo_datetime_t *dt, uo_sec70_t *);
42 const char * uo_monabbrev(int mon);
43 #define YYYY_MM_DD0 11
44 char *yyyy_mm_dd(char *buf, uo_datetime_t *dt, char dash);
45 #define YYYY_MM_DD_HH_MM_SS0 20
46 char *yyyy_mm_dd_hh_mm_ss(char *buf, uo_datetime_t *dt, char dash);
47 int uo_scandate(uo_datetime_t *dt, const char *format, const char *data);
48 
49 
50 #endif
51