1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "win32/apr_arch_atime.h"
19 #include "apr_general.h"
22 apr_status_t apr_get_curtime(struct atime_t *time, apr_time_t *rv)
25 (*rv) = time->currtime;
31 apr_status_t apr_get_sec(struct atime_t *time, apr_int32_t *rv)
34 (*rv) = time->explodedtime->wSecond;
40 apr_status_t apr_get_min(struct atime_t *time, apr_int32_t *rv)
43 (*rv) = time->explodedtime->wMinute;
49 apr_status_t apr_get_hour(struct atime_t *time, apr_int32_t *rv)
52 (*rv) = time->explodedtime->wHour;
58 apr_status_t apr_get_mday(struct atime_t *time, apr_int32_t *rv)
61 (*rv) = time->explodedtime->wDay;
67 apr_status_t apr_get_mon(struct atime_t *time, apr_int32_t *rv)
70 (*rv) = time->explodedtime->wMonth;
76 apr_status_t apr_get_year(struct atime_t *time, apr_int32_t *rv)
79 (*rv) = time->explodedtime->wYear;
85 apr_status_t apr_get_wday(struct atime_t *time, apr_int32_t *rv)
88 (*rv) = time->explodedtime->wDayOfWeek;
94 apr_status_t apr_set_sec(struct atime_t *time, apr_int32_t value)
99 if (time->explodedtime == NULL) {
100 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
103 if (time->explodedtime == NULL) {
106 time->explodedtime->wSecond = value;
110 apr_status_t apr_set_min(struct atime_t *time, apr_int32_t value)
115 if (time->explodedtime == NULL) {
116 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
119 if (time->explodedtime == NULL) {
122 time->explodedtime->wMinute = value;
126 apr_status_t apr_set_hour(struct atime_t *time, apr_int32_t value)
131 if (time->explodedtime == NULL) {
132 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
135 if (time->explodedtime == NULL) {
138 time->explodedtime->wHour = value;
142 apr_status_t apr_set_mday(struct atime_t *time, apr_int32_t value)
147 if (time->explodedtime == NULL) {
148 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
151 if (time->explodedtime == NULL) {
154 time->explodedtime->wDay = value;
158 apr_status_t apr_set_mon(struct atime_t *time, apr_int32_t value)
163 if (time->explodedtime == NULL) {
164 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
167 if (time->explodedtime == NULL) {
170 time->explodedtime->wMonth = value;
174 apr_status_t apr_set_year(struct atime_t *time, apr_int32_t value)
179 if (time->explodedtime == NULL) {
180 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
183 if (time->explodedtime == NULL) {
186 time->explodedtime->wYear = value;
190 apr_status_t apr_set_wday(struct atime_t *time, apr_int32_t value)
195 if (time->explodedtime == NULL) {
196 time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt,
199 if (time->explodedtime == NULL) {
202 time->explodedtime->wDayOfWeek = value;