#include <openssl/e_os2.h>
#include <string.h>
-#include "o_time.h"
+#include "crypto.h"
#ifdef OPENSSL_SYS_VMS
# if __CRTL_VER >= 70000000 && \
static long date_to_julian(int y, int m, int d);
static void julian_to_date(long jd, int *y, int *m, int *d);
-static int julian_adj(struct tm *tm, int off_day, long offset_sec,
+static int julian_adj(const struct tm *tm, int off_day, long offset_sec,
long *pday, int *psec);
int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
}
-int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
+int OPENSSL_gmtime_diff(int *pday, int *psec,
+ const struct tm *from, const struct tm *to)
{
int from_sec, to_sec, diff_sec;
long from_jd, to_jd, diff_day;
diff_sec -= SECS_PER_DAY;
}
- *pday = (int)diff_day;
- *psec = diff_sec;
+ if (pday)
+ *pday = (int)diff_day;
+ if (psec)
+ *psec = diff_sec;
return 1;
/* Convert tm structure and offset into julian day and seconds */
-static int julian_adj(struct tm *tm, int off_day, long offset_sec,
+static int julian_adj(const struct tm *tm, int off_day, long offset_sec,
long *pday, int *psec)
{
int offset_hms, offset_day;