File tree Expand file tree Collapse file tree 2 files changed +0
-57
lines changed Expand file tree Collapse file tree 2 files changed +0
-57
lines changed Original file line number Diff line number Diff line change 77// ===----------------------------------------------------------------------===//
88
99#include " localtime_utils.h"
10- #include " src/__support/File/file.h"
1110#include " src/time/linux/timezone.h"
1211#include " src/time/time_utils.h"
1312
1413namespace LIBC_NAMESPACE_DECL {
1514namespace localtime_utils {
1615
17- void release_file (ErrorOr<File &> error_or_file) {
18- file_usage = 0 ;
19- error_or_file.value ()->close ();
20- }
21-
22- ErrorOr<File &> acquire_file (char &filename) {
23- while (1 ) {
24- if (file_usage == 0 ) {
25- file_usage = 1 ;
26- break ;
27- }
28- }
29-
30- return LIBC_NAMESPACE::openfile (filename, " rb" );
31- }
32-
3316timezone::tzset &get_localtime (struct tm &tm) {
3417 (void )tm;
3518 return nullptr ;
Original file line number Diff line number Diff line change 99#ifndef LLVM_LIBC_SRC_TIME_LINUX_TIMEZONE_H
1010#define LLVM_LIBC_SRC_TIME_LINUX_TIMEZONE_H
1111
12- #include " src/__support/common.h"
13- #include " src/__support/macros/config.h"
14- #include < stddef.h>
15- #include < stdint.h>
16-
17- #include " hdr/types/FILE.h"
18-
1912namespace LIBC_NAMESPACE_DECL {
2013namespace timezone {
2114
22- // accoring to `tzfile`, timezone header if always 44 bytes
23- #define TIMEZONE_HDR_SIZE 44
24-
25- typedef struct {
26- int64_t tt_utoff;
27- uint8_t tt_isdst;
28- uint8_t tt_desigidx;
29-
30- // additional fields
31- int64_t offsets;
32- size_t &size;
33- } ttinfo;
34-
35- typedef struct {
36- uint64_t tzh_ttisutcnt;
37- uint64_t tzh_ttisstdcnt;
38- uint64_t tzh_leapcnt;
39- uint64_t tzh_timecnt;
40- uint64_t tzh_typecnt;
41- uint64_t tzh_charcnt;
42- ttinfo &ttinfo;
43-
44- // additional fields
45- int64_t &tzh_timecnt_transitions;
46- int64_t &tzh_timecnt_indices;
47- size_t tzh_timecnt_number_transitions;
48- int64_t &tz;
49- int8_t global_offset;
50- int8_t global_isdst;
51- } tzset;
52-
53- tzset &get_tzset (::FILE &file);
54-
5515} // namespace timezone
5616} // namespace LIBC_NAMESPACE_DECL
5717
You can’t perform that action at this time.
0 commit comments