/usr/lib/ats-anairiats-0.2.11/libc/CATS/time.cats is in ats-lang-anairiats 0.2.11-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | /************************************************************************/
/* */
/* Applied Type System */
/* */
/* Hongwei Xi */
/* */
/************************************************************************/
/*
** ATS - Unleashing the Potential of Types!
**
** Copyright (C) 2002-2010 Hongwei Xi.
**
** ATS is free software; you can redistribute it and/or modify it under
** the terms of the GNU General Public License as published by the Free
** Software Foundation; either version 2.1, or (at your option) any later
** version.
**
** ATS is distributed in the hope that it will be useful, but WITHOUT ANY
** WARRANTY; without even the implied warranty of MERCHANTABILITY or
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
** for more details.
**
** You should have received a copy of the GNU General Public License
** along with ATS; see the file COPYING. If not, please write to the
** Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
** 02110-1301, USA.
*/
/* ****** ****** */
/* author: Hongwei Xi (hwxi AT cs DOT bu DOT edu) */
/* ****** ****** */
#ifndef ATS_LIBC_TIME_CATS
#define ATS_LIBC_TIME_CATS
/* ****** ****** */
#include <time.h>
/* ****** ****** */
#include "libc/sys/CATS/types.cats"
/* ****** ****** */
typedef struct tm ats_tm_struct_type ;
typedef struct timespec ats_timespec_type ;
typedef struct itimerspec ats_itimerspec_type ;
/* ****** ****** */
#define atslib_difftime difftime
/* ****** ****** */
ATSinline()
ats_int_type
atslib_tm_get_sec
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_sec ;
} // end of [atslib_tm_get_sec]
ATSinline()
ats_int_type
atslib_tm_get_min
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_min ;
} // end of [atslib_tm_get_min]
ATSinline()
ats_int_type
atslib_tm_get_hour
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_hour ;
} // end of [atslib_tm_get_hour]
ATSinline()
ats_int_type
atslib_tm_get_mday
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_mday ;
} // end of [atslib_tm_get_mday]
ATSinline()
ats_int_type
atslib_tm_get_mon
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_mon ;
} // end of [atslib_tm_get_mon]
ATSinline()
ats_int_type
atslib_tm_get_year
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_year ;
} // end of [atslib_tm_get_year]
ATSinline()
ats_int_type
atslib_tm_get_wday
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_wday ;
} // end of [atslib_tm_get_wday]
ATSinline()
ats_int_type
atslib_tm_get_yday
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_yday ;
} // end of [atslib_tm_get_yday]
ATSinline()
ats_int_type
atslib_tm_get_isdst
(ats_ptr_type tm) {
return ((struct tm*)tm)->tm_isdst ;
} // end of [atslib_tm_get_isdst]
//
/* ****** ****** */
ATSinline()
ats_time_type
atslib_time_get () { return time((time_t*)0) ; }
ATSinline()
ats_int_type
atslib_time_get_and_set
(ats_ref_type p) {
time_t err = time((time_t*)p) ;
return (err > 0) ? ats_true_bool : ats_false_bool ;
} // end of [atslib_time_get_and_set]
/* ****** ****** */
#define atslib_ctime ctime
#define atslib_ctime_r ctime_r
/* ****** ****** */
#define atslib_localtime localtime
#define atslib_localtime_r localtime_r
#define atslib_gmtime gmtime
#define atslib_gmtime_r gmtime_r
/* ****** ****** */
#define atslib_mktime mktime
/* ****** ****** */
#define atslib_asctime asctime
#define atslib_strftime strftime
/* ****** ****** */
extern int getdate_err ;
ATSinline()
ats_int_type
atslib_getdate_err_get() { return getdate_err ;}
//
ATSinline()
ats_void_type
atslib_getdate_err_set(ats_int_type n) { getdate_err = n ; return ; }
//
#define atslib_getdate getdate
#define atslib_strptime strptime
/* ****** ****** */
#define atslib_tzset tzset
/* ****** ****** */
#define atslib_clock clock
/* ****** ****** */
#define atslib_nanosleep nanosleep
#define atslib_nanosleep_null(ts) nanosleep_null(ts, NULL)
/* ****** ****** */
#define atslib_clock_gettime clock_gettime
#define atslib_clock_getres clock_getres
#define atslib_clock_settime clock_settime
/* ****** ****** */
#define atslib_timer_create timer_create
#define atslib_timer_create_null(cid, p_tid) timer_create(cid, NULL, p_tid)
#define atslib_timer_delete timer_delete
#define atslib_timer_gettime timer_gettime
#define atslib_timer_settime timer_settime
#define atslib_timer_getoverrun timer_getoverrun
/* ****** ****** */
#endif /* ATS_LIBC_TIME_CATS */
/* end of [time.cats] */
|