From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id 805363858C52 for ; Tue, 5 Apr 2022 04:04:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 805363858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSW.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id bQtDnCzW5gTZYbaQFn5il1; Tue, 05 Apr 2022 04:04:03 +0000 Received: from BWINGLISD.cg.shawcable.net. ([184.64.124.72]) by cmsmtp with ESMTP id baQEnIhvMd7RfbaQEnnahs; Tue, 05 Apr 2022 04:04:03 +0000 X-Authority-Analysis: v=2.4 cv=XrLphHJ9 c=1 sm=1 tr=0 ts=624bbfb3 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=3WJNtXKqhctJ-ZFSiKEA:9 a=QEXdDO2ut3YA:10 a=YNLhq46WsbCP_cmCNw0A:9 a=B2y7HmGcmWMA:10 From: Brian Inglis To: Newlib Subject: [PATCH 1/2] tzset.c: doc update POSIX angle bracket <> support Date: Mon, 4 Apr 2022 22:03:57 -0600 Message-Id: <20220405040358.18332-2-Brian.Inglis@SystematicSW.ab.ca> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405040358.18332-1-Brian.Inglis@SystematicSW.ab.ca> References: <20220405040358.18332-1-Brian.Inglis@SystematicSW.ab.ca> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.35.1" Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfE+ZH+7/MKDhWFQtIBbcE9JNGufzbQP7XmQEeDhhGjM20jlm1By/pcvQkk9lo3KRfVuFoxxYSYjE22/jM/lxh/w35qrJSLGD1ejQ8r+UJE8TqdmkoDYE 4WN+rYr53u+YYPVL6KK23+L/mmBVClF94FCOjWdh3DZ7lPC+gMrGRoGO+fKeZOopNDdKLPze4OTs/cwpGNTcW8wd/6EhkTI1USMXNUAtJlueqCFmGe7BaYPA 2ANn31KqaE8V/uiZ3v1gK7KaSNAaRi+A1uj4tAPAcoQ= X-Spam-Status: No, score=-1169.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2022 04:04:05 -0000 This is a multi-part message in MIME format. --------------2.35.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit add format and structure to doc --- newlib/libc/time/tzset.c | 110 ++++++++++++++++++++++++++++----------- 1 file changed, 79 insertions(+), 31 deletions(-) --------------2.35.1 Content-Type: text/x-patch; name="0001-tzset.c-doc-update-POSIX-angle-bracket-support.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-tzset.c-doc-update-POSIX-angle-bracket-support.patch" diff --git a/newlib/libc/time/tzset.c b/newlib/libc/time/tzset.c index 3b4c01c660a4..77accbfb0485 100644 --- a/newlib/libc/time/tzset.c +++ b/newlib/libc/time/tzset.c @@ -1,6 +1,6 @@ /* FUNCTION -<>---set timezone characteristics from TZ environment variable +<>---set timezone characteristics from <[TZ]> environment variable INDEX tzset @@ -13,36 +13,84 @@ SYNOPSIS void _tzset_r (struct _reent *<[reent_ptr]>); DESCRIPTION -<> examines the TZ environment variable and sets up the three -external variables: <<_timezone>>, <<_daylight>>, and <>. The -value of <<_timezone>> shall be the offset from the current time zone -to GMT. The value of <<_daylight>> shall be 0 if there is no daylight -savings time for the current time zone, otherwise it will be non-zero. -The <> array has two entries: the first is the name of the -standard time zone, the second is the name of the daylight-savings time -zone. - -The TZ environment variable is expected to be in the following POSIX -format: - - stdoffset1[dst[offset2][,start[/time1],end[/time2]]] - -where: std is the name of the standard time-zone (minimum 3 chars) - offset1 is the value to add to local time to arrive at Universal time - it has the form: hh[:mm[:ss]] - dst is the name of the alternate (daylight-savings) time-zone (min 3 chars) - offset2 is the value to add to local time to arrive at Universal time - it has the same format as the std offset - start is the day that the alternate time-zone starts - time1 is the optional time that the alternate time-zone starts - (this is in local time and defaults to 02:00:00 if not specified) - end is the day that the alternate time-zone ends - time2 is the time that the alternate time-zone ends - (it is in local time and defaults to 02:00:00 if not specified) - -Note that there is no white-space padding between fields. Also note that -if TZ is null, the default is Universal GMT which has no daylight-savings -time. If TZ is empty, the default EST5EDT is used. +<> examines the <[TZ]> environment variable and sets up the three +external variables: <<_timezone>>, <<_daylight>>, and <>. +The value of <<_timezone>> shall be the offset from the current time +to Universal Time. +The value of <<_daylight>> shall be 0 if there is no daylight savings +time for the current time zone, otherwise it will be non-zero. +The <> array has two entries: the first is the designation of the +standard time period, the second is the designation of the alternate time +period. + +The <[TZ]> environment variable is expected to be in the following POSIX +format (spaces inserted for clarity): + + <[std]> <[offset1]> [<[dst]> [<[offset2]>] [,<[start]> [/<[time1]>], <[end]> [/<[time2]>]]] + +where: + +<[std]> is the designation for the standard time period (minimum 3, +maximum <> bytes) in one of two forms: + +*- quoted within angle bracket '<' '>' characters: portable numeric +sign or alphanumeric characters in the current locale; the +quoting characters are not included in the designation + +*- unquoted: portable alphabetic characters in the current locale + +<[offset1]> is the value to add to local standard time to get Universal Time; +it has the format: + + [<[S]>]<[hh]>[:<[mm]>[:<[ss]>]] + + where: + + <[S]> is an optional numeric sign character; if negative '-', the + time zone is East of the International Reference + Meridian; else it is positive and West, and '+' may be used + + <[hh]> is the required numeric hour between 0 and 24 + + <[mm]> is the optional numeric minute between 0 and 59 + + <[ss]> is the optional numeric second between 0 and 59 + +<[dst]> is the designation of the alternate (daylight saving or +summer) time period, with the same limits and forms as +the standard time period designation + +<[offset2]> is the value to add to local alternate time to get +Universal Time; it has the same format as <[offset1]> + +<[start]> is the date in the year that alternate time starts; +the form may be one of: +(quotes "'" around characters below are used only to distinguish literals) + + <[n]> zero based Julian day (0-365), counting February 29 Leap days + + 'J'<[n]> one based Julian day (1-365), not counting February 29 Leap + days; in all years day 59 is February 28 and day 60 is March 1 + + 'M'<[m]>'.'<[w]>'.'<[d]> + month <[m]> (1-12) week <[w]> (1-5) day <[d]> (0-6) where week 1 is + the first week in month <[m]> with day <[d]>; week 5 is the last + week in the month; day 0 is Sunday + +<[time1]> is the optional local time that alternate time starts, in +the same format as <[offset1]> without any sign, and defaults +to 02:00:00 + +<[end]> is the date in the year that alternate time ends, in the same +forms as <[start]> + +<[time2]> is the optional local time that alternate time ends, in +the same format as <[offset1]> without any sign, and +defaults to 02:00:00 + +Note that there is no white-space padding between fields. Also note that +if <[TZ]> is null, the default is Universal Time which has no daylight saving +time. If <[TZ]> is empty, the default EST5EDT is used. The function <<_tzset_r>> is identical to <> only it is reentrant and is used for applications that use multiple threads. --------------2.35.1--