From 9a53db28b86120d2e31e7fd25feaa50486d6a1d0 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 23 Apr 1995 02:42:47 +0000 Subject: [PATCH] Implement primitives to get the timezone and daylight-savings information from the C library. --- v7/src/microcode/os2env.c | 16 ++++++++++++++-- v7/src/microcode/pros2fs.c | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/v7/src/microcode/os2env.c b/v7/src/microcode/os2env.c index ba8a29c6f..99999e37b 100644 --- a/v7/src/microcode/os2env.c +++ b/v7/src/microcode/os2env.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: os2env.c,v 1.2 1994/12/19 22:31:27 cph Exp $ +$Id: os2env.c,v 1.3 1995/04/23 02:42:38 cph Exp $ -Copyright (c) 1994 Massachusetts Institute of Technology +Copyright (c) 1994-95 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -112,6 +112,18 @@ OS_encode_time (struct time_structure * buffer) } } +long +OS2_timezone (void) +{ + return (_timezone); +} + +int +OS2_daylight_savings_p (void) +{ + return (_daylight); +} + static double initial_rtc; static void diff --git a/v7/src/microcode/pros2fs.c b/v7/src/microcode/pros2fs.c index 41b745cf6..82e4fa836 100644 --- a/v7/src/microcode/pros2fs.c +++ b/v7/src/microcode/pros2fs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pros2fs.c,v 1.4 1995/03/21 01:05:22 cph Exp $ +$Id: pros2fs.c,v 1.5 1995/04/23 02:42:47 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -40,6 +40,8 @@ MIT in each case. */ extern FILESTATUS3 * OS2_read_file_status (const char *); extern void OS2_write_file_status (const char *, FILESTATUS3 *); extern char * OS2_drive_type (char); +extern long OS2_timezone (void); +extern long OS2_daylight_savings_p (void); #ifndef FILE_TOUCH_OPEN_TRIES #define FILE_TOUCH_OPEN_TRIES 5 @@ -406,3 +408,15 @@ DEFINE_PRIMITIVE ("DOS-QUERY-MEMORY", Prim_dos_query_memory, 2, 2, 0) (ulong_to_integer (flags)))); } } + +DEFINE_PRIMITIVE ("OS2-TIMEZONE", Prim_OS2_timezone, 0, 0, 0) +{ + PRIMITIVE_HEADER (0); + PRIMITIVE_RETURN (long_to_integer (OS2_timezone ())); +} + +DEFINE_PRIMITIVE ("OS2-DAYLIGHT-SAVINGS-TIME?", Prim_OS2_dst_p, 0, 0, 0) +{ + PRIMITIVE_HEADER (0); + PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (OS2_daylight_savings_p ())); +} -- 2.25.1