summaryrefslogtreecommitdiff
path: root/libexslt/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexslt/date.c')
-rw-r--r--libexslt/date.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/libexslt/date.c b/libexslt/date.c
index 8f34a75f..60d353d5 100644
--- a/libexslt/date.c
+++ b/libexslt/date.c
@@ -40,13 +40,8 @@
#include <string.h>
#include <limits.h>
-
-#ifdef HAVE_ERRNO_H
#include <errno.h>
-#endif
-#ifdef HAVE_MATH_H
#include <math.h>
-#endif
/* needed to get localtime_r on Solaris */
#ifdef __sun
@@ -55,9 +50,7 @@
#endif
#endif
-#ifdef HAVE_TIME_H
#include <time.h>
-#endif
/*
* types of date and/or time (from schema datatypes)
@@ -103,19 +96,6 @@ struct _exsltDateDurVal {
/****************************************************************
* *
- * Compat./Port. macros *
- * *
- ****************************************************************/
-
-#if defined(HAVE_TIME_H) \
- && (defined(HAVE_LOCALTIME) || defined(HAVE_LOCALTIME_R)) \
- && (defined(HAVE_GMTIME) || defined(HAVE_GMTIME_R)) \
- && defined(HAVE_TIME)
-#define WITH_TIME
-#endif
-
-/****************************************************************
- * *
* Convenience macros and functions *
* *
****************************************************************/
@@ -729,7 +709,6 @@ exsltDateFreeDuration (exsltDateDurValPtr duration) {
xmlFree(duration);
}
-#ifdef WITH_TIME
/**
* exsltDateCurrent:
*
@@ -745,16 +724,13 @@ exsltDateCurrent (void)
time_t secs;
int local_s, gm_s;
exsltDateValPtr ret;
-#ifdef HAVE_ERRNO_H
char *source_date_epoch;
-#endif /* HAVE_ERRNO_H */
int override = 0;
ret = exsltDateCreateDate(XS_DATETIME);
if (ret == NULL)
return NULL;
-#ifdef HAVE_ERRNO_H
/*
* Allow the date and time to be set externally by an exported
* environment variable to enable reproducible builds.
@@ -776,7 +752,6 @@ exsltDateCurrent (void)
#endif
}
}
-#endif /* HAVE_ERRNO_H */
if (override == 0) {
/* get current time */
@@ -843,7 +818,6 @@ exsltDateCurrent (void)
return ret;
}
-#endif
/**
* exsltDateParse:
@@ -1802,7 +1776,6 @@ static xmlChar *
exsltDateDateTime (void)
{
xmlChar *ret = NULL;
-#ifdef WITH_TIME
exsltDateValPtr cur;
cur = exsltDateCurrent();
@@ -1810,7 +1783,6 @@ exsltDateDateTime (void)
ret = exsltDateFormatDateTime(cur);
exsltDateFreeDate(cur);
}
-#endif
return ret;
}
@@ -1838,10 +1810,8 @@ exsltDateDate (const xmlChar *dateTime)
xmlChar *ret = NULL;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return NULL;
} else {
dt = exsltDateParse(dateTime);
@@ -1882,10 +1852,8 @@ exsltDateTime (const xmlChar *dateTime)
xmlChar *ret = NULL;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return NULL;
} else {
dt = exsltDateParse(dateTime);
@@ -1931,10 +1899,8 @@ exsltDateYear (const xmlChar *dateTime)
double ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -1982,9 +1948,7 @@ exsltDateLeapYear (const xmlChar *dateTime)
xmlXPathObjectPtr ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
-#endif
} else {
dt = exsltDateParse(dateTime);
if ((dt != NULL) &&
@@ -2034,10 +1998,8 @@ exsltDateMonthInYear (const xmlChar *dateTime)
double ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2183,10 +2145,8 @@ exsltDateWeekInYear (const xmlChar *dateTime)
long diy, diw, year, ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2251,10 +2211,8 @@ exsltDateWeekInMonth (const xmlChar *dateTime)
long fdiy, fdiw, ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2305,10 +2263,8 @@ exsltDateDayInYear (const xmlChar *dateTime)
long ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2354,10 +2310,8 @@ exsltDateDayInMonth (const xmlChar *dateTime)
double ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2402,10 +2356,8 @@ exsltDateDayOfWeekInMonth (const xmlChar *dateTime)
long ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2451,10 +2403,8 @@ exsltDateDayInWeek (const xmlChar *dateTime)
long diy, ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2582,10 +2532,8 @@ exsltDateHourInDay (const xmlChar *dateTime)
double ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2628,10 +2576,8 @@ exsltDateMinuteInHour (const xmlChar *dateTime)
double ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2676,10 +2622,8 @@ exsltDateSecondInMinute (const xmlChar *dateTime)
double ret;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -2950,10 +2894,8 @@ exsltDateSeconds (const xmlChar *dateTime)
double ret = xmlXPathNAN;
if (dateTime == NULL) {
-#ifdef WITH_TIME
dt = exsltDateCurrent();
if (dt == NULL)
-#endif
return xmlXPathNAN;
} else {
dt = exsltDateParse(dateTime);
@@ -3132,7 +3074,6 @@ exsltDateDuration (const xmlChar *number)
* *
****************************************************************/
-#ifdef WITH_TIME
/**
* exsltDateDateTimeFunction:
* @ctxt: an XPath parser context
@@ -3156,7 +3097,6 @@ exsltDateDateTimeFunction (xmlXPathParserContextPtr ctxt, int nargs)
else
xmlXPathReturnString(ctxt, ret);
}
-#endif
/**
* exsltDateDateFunction:
@@ -3769,11 +3709,9 @@ exsltDateRegister (void)
xsltRegisterExtModuleFunction ((const xmlChar *) "date",
(const xmlChar *) EXSLT_DATE_NAMESPACE,
exsltDateDateFunction);
-#ifdef WITH_TIME
xsltRegisterExtModuleFunction ((const xmlChar *) "date-time",
(const xmlChar *) EXSLT_DATE_NAMESPACE,
exsltDateDateTimeFunction);
-#endif
xsltRegisterExtModuleFunction ((const xmlChar *) "day-abbreviation",
(const xmlChar *) EXSLT_DATE_NAMESPACE,
exsltDateDayAbbreviationFunction);
@@ -3864,12 +3802,10 @@ exsltDateXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
(const xmlChar *) "date",
(const xmlChar *) EXSLT_DATE_NAMESPACE,
exsltDateDateFunction)
-#ifdef WITH_TIME
&& !xmlXPathRegisterFuncNS(ctxt,
(const xmlChar *) "date-time",
(const xmlChar *) EXSLT_DATE_NAMESPACE,
exsltDateDateTimeFunction)
-#endif
&& !xmlXPathRegisterFuncNS(ctxt,
(const xmlChar *) "day-abbreviation",
(const xmlChar *) EXSLT_DATE_NAMESPACE,