dostime.h
Go to the documentation of this file.
1#pragma once
2#ifndef DOSTIME_H
3#define DOSTIME_H
4
5/*
6 dostime.h - routines for converting UNIX time to MS-DOS time.
7
8 Various Copyrights:
9
10 First written by Mark Adler, Richard B. Wales, Jean-loup Gailly,
11 Kai Uwe Rommel, Onno van der Linden and Igor Mandrichenko (1990-1997).
12 Tweaked further by Bryan Burns (1999).
13 Redesigned with full error checks by Alexis Wilke (2015).
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version 2
18 of the License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28*/
29
40#include <time.h>
41#include <inttypes.h>
42
43
44#ifdef __cplusplus
45extern "C"
46{
47#endif
48
49
50typedef uint32_t dostime_t;
51
55dostime_t dostime(int year, int month, int day, int hour, int minute, int second);
56dostime_t unix2dostime(time_t unix_time);
57
58
59#ifdef __cplusplus
60} // extern "C"
61#endif
62
63// Local Variables:
64// mode: cpp
65// indent-tabs-mode: nil
66// c-basic-offset: 4
67// tab-width: 4
68// End:
69
70// vim: ts=2 sw=2 et
71#endif
dostime_t mindostime()
Return the minimum possible value.
Definition: dostime.c:81
time_t dos2unixtime(dostime_t dostime)
Convert a DOS time to a Unix time.
Definition: dostime.c:131
dostime_t maxdostime()
Return the maximum possible value .
Definition: dostime.c:105
uint32_t dostime_t
Definition: dostime.h:50
dostime_t unix2dostime(time_t unix_time)
Convert a Unix date to a DOS date.
Definition: dostime.c:219
dostime_t dostime(int year, int month, int day, int hour, int minute, int second)
Definition: dostime.c:188