blob: 8d31c6f71422e883b31236e4d8271cf55574991f [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
2
3Copyright (c) 2007-2008 Michael G Schwern
4
5This software originally derived from Paul Sheer's pivotal_gmtime_r.c.
6
7The MIT License:
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027*/
28#ifndef TIME64_H
29#define TIME64_H
30
Elliott Hughes8d77bce2014-04-22 13:55:58 -070031#if defined(__LP64__)
32
Elliott Hughes52defb72014-05-05 17:14:02 -070033#error Your time_t is already 64-bit.
Elliott Hughes8d77bce2014-04-22 13:55:58 -070034
35#else
36
37/* Legacy cruft for LP32 where time_t was 32-bit. */
38
Fred Fettingerb5239ed2009-11-20 16:57:14 -060039#include <sys/cdefs.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040#include <time.h>
41#include <stdint.h>
42
Fred Fettingerb5239ed2009-11-20 16:57:14 -060043__BEGIN_DECLS
44
Elliott Hughes8d77bce2014-04-22 13:55:58 -070045typedef int64_t time64_t;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080046
zijunzhaoe6202662023-01-03 23:32:18 +000047char* _Nullable asctime64(const struct tm* _Nonnull);
48char* _Nullable asctime64_r(const struct tm* _Nonnull, char* _Nonnull);
49char* _Nullable ctime64(const time64_t* _Nonnull);
50char* _Nullable ctime64_r(const time64_t* _Nonnull, char* _Nonnull);
51struct tm* _Nullable gmtime64(const time64_t* _Nonnull);
52struct tm* _Nullable gmtime64_r(const time64_t* _Nonnull, struct tm* _Nonnull);
53struct tm* _Nullable localtime64(const time64_t* _Nonnull);
54struct tm* _Nullable localtime64_r(const time64_t* _Nonnull, struct tm* _Nonnull);
55time64_t mktime64(const struct tm* _Nonnull);
56time64_t timegm64(const struct tm* _Nonnull);
57time64_t timelocal64(const struct tm* _Nonnull);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080058
Fred Fettingerb5239ed2009-11-20 16:57:14 -060059__END_DECLS
60
Elliott Hughes8d77bce2014-04-22 13:55:58 -070061#endif
62
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080063#endif /* TIME64_H */