summaryrefslogtreecommitdiff
path: root/time/unix
diff options
context:
space:
mode:
Diffstat (limited to 'time/unix')
-rw-r--r--time/unix/time.c50
-rw-r--r--time/unix/timestr.c18
2 files changed, 35 insertions, 33 deletions
diff --git a/time/unix/time.c b/time/unix/time.c
index 60a29c189..96b5d6644 100644
--- a/time/unix/time.c
+++ b/time/unix/time.c
@@ -76,9 +76,9 @@
/* End System Headers */
-apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input)
+apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input)
{
- *result = (apr_time_t)input * AP_USEC_PER_SEC;
+ *result = (apr_time_t)input * APR_USEC_PER_SEC;
return APR_SUCCESS;
}
@@ -87,11 +87,11 @@ apr_time_t apr_now(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
- return tv.tv_sec * AP_USEC_PER_SEC + tv.tv_usec;
+ return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec;
}
-static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm)
+static void tm_to_exp(apr_exploded_time_t *xt, struct tm *tm)
{
xt->tm_sec = tm->tm_sec;
xt->tm_min = tm->tm_min;
@@ -105,14 +105,14 @@ static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm)
}
-apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input)
+apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input)
{
- time_t t = input / AP_USEC_PER_SEC;
+ time_t t = input / APR_USEC_PER_SEC;
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
struct tm banana;
#endif
- result->tm_usec = input % AP_USEC_PER_SEC;
+ result->tm_usec = input % APR_USEC_PER_SEC;
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
gmtime_r(&t, &banana);
@@ -124,13 +124,13 @@ apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input)
return APR_SUCCESS;
}
-apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input)
+apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input)
{
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
- time_t t = input / AP_USEC_PER_SEC;
+ time_t t = input / APR_USEC_PER_SEC;
struct tm apricot;
- result->tm_usec = input % AP_USEC_PER_SEC;
+ result->tm_usec = input % APR_USEC_PER_SEC;
localtime_r(&t, &apricot);
tm_to_exp(result, &apricot);
@@ -152,10 +152,10 @@ apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input)
}
#endif
#else
- time_t t = input / AP_USEC_PER_SEC;
+ time_t t = input / APR_USEC_PER_SEC;
struct tm *tmx;
- result->tm_usec = input % AP_USEC_PER_SEC;
+ result->tm_usec = input % APR_USEC_PER_SEC;
tmx = localtime(&t);
tm_to_exp(result, tmx);
@@ -181,7 +181,7 @@ apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input)
}
-apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt)
+apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt)
{
int year;
time_t days;
@@ -211,18 +211,19 @@ apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt)
return APR_EBADDATE;
}
days -= xt->tm_gmtoff;
- *t = days * AP_USEC_PER_SEC + xt->tm_usec;
+ *t = days * APR_USEC_PER_SEC + xt->tm_usec;
return APR_SUCCESS;
}
apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime)
{
- (*ostime)->tv_usec = *aprtime % AP_USEC_PER_SEC;
- (*ostime)->tv_sec = *aprtime / AP_USEC_PER_SEC;
+ (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC;
+ (*ostime)->tv_sec = *aprtime / APR_USEC_PER_SEC;
return APR_SUCCESS;
}
-apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime)
+apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime,
+ apr_exploded_time_t *aprtime)
{
(*ostime)->tm_sec = aprtime->tm_sec;
(*ostime)->tm_min = aprtime->tm_min;
@@ -239,12 +240,12 @@ apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t
apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime,
apr_pool_t *cont)
{
- *aprtime = (*ostime)->tv_sec * AP_USEC_PER_SEC + (*ostime)->tv_usec;
+ *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec;
return APR_SUCCESS;
}
-apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime,
- apr_os_exp_time_t **ostime, apr_pool_t *cont)
+apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime,
+ apr_os_exp_time_t **ostime, apr_pool_t *cont)
{
aprtime->tm_sec = (*ostime)->tm_sec;
aprtime->tm_min = (*ostime)->tm_min;
@@ -264,14 +265,15 @@ void apr_sleep(apr_interval_time_t t)
DosSleep(t/1000);
#else
struct timeval tv;
- tv.tv_usec = t % AP_USEC_PER_SEC;
- tv.tv_sec = t / AP_USEC_PER_SEC;
+ tv.tv_usec = t % APR_USEC_PER_SEC;
+ tv.tv_sec = t / APR_USEC_PER_SEC;
select(0, NULL, NULL, NULL, &tv);
#endif
}
#ifdef OS2
-apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time)
+apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date,
+ FTIME os2time)
{
struct tm tmpdate;
@@ -285,7 +287,7 @@ apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2
tmpdate.tm_year = os2date.year + 80;
tmpdate.tm_isdst = -1;
- *result = mktime(&tmpdate) * AP_USEC_PER_SEC;
+ *result = mktime(&tmpdate) * APR_USEC_PER_SEC;
return APR_SUCCESS;
}
#endif
diff --git a/time/unix/timestr.c b/time/unix/timestr.c
index 22b342dcf..52aa1f148 100644
--- a/time/unix/timestr.c
+++ b/time/unix/timestr.c
@@ -68,18 +68,18 @@
#endif
/* End System Headers */
-APR_VAR_EXPORT const char ap_month_snames[12][4] =
+APR_VAR_EXPORT const char apr_month_snames[12][4] =
{
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-APR_VAR_EXPORT const char ap_day_snames[7][4] =
+APR_VAR_EXPORT const char apr_day_snames[7][4] =
{
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
{
- ap_exploded_time_t xt;
+ apr_exploded_time_t xt;
const char *s;
int real_year;
@@ -88,7 +88,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
/* example: "Sat, 08 Jan 2000 18:31:41 GMT" */
/* 12345678901234567890123456789 */
- s = &ap_day_snames[xt.tm_wday][0];
+ s = &apr_day_snames[xt.tm_wday][0];
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = *s++;
@@ -97,7 +97,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
*date_str++ = xt.tm_mday / 10 + '0';
*date_str++ = xt.tm_mday % 10 + '0';
*date_str++ = ' ';
- s = &ap_month_snames[xt.tm_mon][0];
+ s = &apr_month_snames[xt.tm_mon][0];
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = *s++;
@@ -127,7 +127,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
apr_status_t apr_ctime(char *date_str, apr_time_t t)
{
- ap_exploded_time_t xt;
+ apr_exploded_time_t xt;
const char *s;
int real_year;
@@ -135,12 +135,12 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t)
/* 123456789012345678901234 */
apr_explode_localtime(&xt, t);
- s = &ap_day_snames[xt.tm_wday][0];
+ s = &apr_day_snames[xt.tm_wday][0];
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = ' ';
- s = &ap_month_snames[xt.tm_mon][0];
+ s = &apr_month_snames[xt.tm_mon][0];
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = *s++;
@@ -168,7 +168,7 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t)
}
apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max,
- const char *format, ap_exploded_time_t *xt)
+ const char *format, apr_exploded_time_t *xt)
{
struct tm tm;