xref: /aosp_15_r20/external/libcxx/include/ctime (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Worker// -*- C++ -*-
2*58b9f456SAndroid Build Coastguard Worker//===---------------------------- ctime -----------------------------------===//
3*58b9f456SAndroid Build Coastguard Worker//
4*58b9f456SAndroid Build Coastguard Worker//                     The LLVM Compiler Infrastructure
5*58b9f456SAndroid Build Coastguard Worker//
6*58b9f456SAndroid Build Coastguard Worker// This file is dual licensed under the MIT and the University of Illinois Open
7*58b9f456SAndroid Build Coastguard Worker// Source Licenses. See LICENSE.TXT for details.
8*58b9f456SAndroid Build Coastguard Worker//
9*58b9f456SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
10*58b9f456SAndroid Build Coastguard Worker
11*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CTIME
12*58b9f456SAndroid Build Coastguard Worker#define _LIBCPP_CTIME
13*58b9f456SAndroid Build Coastguard Worker
14*58b9f456SAndroid Build Coastguard Worker/*
15*58b9f456SAndroid Build Coastguard Worker    ctime synopsis
16*58b9f456SAndroid Build Coastguard Worker
17*58b9f456SAndroid Build Coastguard WorkerMacros:
18*58b9f456SAndroid Build Coastguard Worker
19*58b9f456SAndroid Build Coastguard Worker    NULL
20*58b9f456SAndroid Build Coastguard Worker    CLOCKS_PER_SEC
21*58b9f456SAndroid Build Coastguard Worker    TIME_UTC // C++17
22*58b9f456SAndroid Build Coastguard Worker
23*58b9f456SAndroid Build Coastguard Workernamespace std
24*58b9f456SAndroid Build Coastguard Worker{
25*58b9f456SAndroid Build Coastguard Worker
26*58b9f456SAndroid Build Coastguard WorkerTypes:
27*58b9f456SAndroid Build Coastguard Worker
28*58b9f456SAndroid Build Coastguard Worker    clock_t
29*58b9f456SAndroid Build Coastguard Worker    size_t
30*58b9f456SAndroid Build Coastguard Worker    time_t
31*58b9f456SAndroid Build Coastguard Worker    tm
32*58b9f456SAndroid Build Coastguard Worker    timespec // C++17
33*58b9f456SAndroid Build Coastguard Worker
34*58b9f456SAndroid Build Coastguard Workerclock_t clock();
35*58b9f456SAndroid Build Coastguard Workerdouble difftime(time_t time1, time_t time0);
36*58b9f456SAndroid Build Coastguard Workertime_t mktime(tm* timeptr);
37*58b9f456SAndroid Build Coastguard Workertime_t time(time_t* timer);
38*58b9f456SAndroid Build Coastguard Workerchar* asctime(const tm* timeptr);
39*58b9f456SAndroid Build Coastguard Workerchar* ctime(const time_t* timer);
40*58b9f456SAndroid Build Coastguard Workertm*    gmtime(const time_t* timer);
41*58b9f456SAndroid Build Coastguard Workertm* localtime(const time_t* timer);
42*58b9f456SAndroid Build Coastguard Workersize_t strftime(char* restrict s, size_t maxsize, const char* restrict format,
43*58b9f456SAndroid Build Coastguard Worker                const tm* restrict timeptr);
44*58b9f456SAndroid Build Coastguard Workerint timespec_get( struct timespec *ts, int base); // C++17
45*58b9f456SAndroid Build Coastguard Worker}  // std
46*58b9f456SAndroid Build Coastguard Worker
47*58b9f456SAndroid Build Coastguard Worker*/
48*58b9f456SAndroid Build Coastguard Worker
49*58b9f456SAndroid Build Coastguard Worker#include <__config>
50*58b9f456SAndroid Build Coastguard Worker#include <time.h>
51*58b9f456SAndroid Build Coastguard Worker
52*58b9f456SAndroid Build Coastguard Worker#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
53*58b9f456SAndroid Build Coastguard Worker#pragma GCC system_header
54*58b9f456SAndroid Build Coastguard Worker#endif
55*58b9f456SAndroid Build Coastguard Worker
56*58b9f456SAndroid Build Coastguard Worker_LIBCPP_BEGIN_NAMESPACE_STD
57*58b9f456SAndroid Build Coastguard Worker
58*58b9f456SAndroid Build Coastguard Workerusing ::clock_t;
59*58b9f456SAndroid Build Coastguard Workerusing ::size_t;
60*58b9f456SAndroid Build Coastguard Workerusing ::time_t;
61*58b9f456SAndroid Build Coastguard Workerusing ::tm;
62*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
63*58b9f456SAndroid Build Coastguard Workerusing ::timespec;
64*58b9f456SAndroid Build Coastguard Worker#endif
65*58b9f456SAndroid Build Coastguard Workerusing ::clock;
66*58b9f456SAndroid Build Coastguard Workerusing ::difftime;
67*58b9f456SAndroid Build Coastguard Workerusing ::mktime;
68*58b9f456SAndroid Build Coastguard Workerusing ::time;
69*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
70*58b9f456SAndroid Build Coastguard Workerusing ::asctime;
71*58b9f456SAndroid Build Coastguard Workerusing ::ctime;
72*58b9f456SAndroid Build Coastguard Workerusing ::gmtime;
73*58b9f456SAndroid Build Coastguard Workerusing ::localtime;
74*58b9f456SAndroid Build Coastguard Worker#endif
75*58b9f456SAndroid Build Coastguard Workerusing ::strftime;
76*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
77*58b9f456SAndroid Build Coastguard Workerusing ::timespec_get;
78*58b9f456SAndroid Build Coastguard Worker#endif
79*58b9f456SAndroid Build Coastguard Worker
80*58b9f456SAndroid Build Coastguard Worker_LIBCPP_END_NAMESPACE_STD
81*58b9f456SAndroid Build Coastguard Worker
82*58b9f456SAndroid Build Coastguard Worker#endif  // _LIBCPP_CTIME
83