For your possible interest,
Kevin J. McCarthy wrote in
<[email protected]>:
|Extract helpers check_time() and check_year() to be reused by the
|reverse scan function created next.
'BSD Mail 8.1[.1], 1996-06-14 (version still says "8.1 6/6/93")'
came with a template parser for that, which later was improved (in
NetBSD). That data effectively boils down to
/* Template characters for cmatch_data.tdata:
* 'A' An upper case char
* 'a' A lower case char
* ' ' A space
* '0' A digit
* 'O' An optional digit or space; MUST be followed by '0space'!
* ':' A colon
* '+' Either a plus or a minus sign */
static struct a_header_cmatch_data const a_header_cmatch_data[] = {
{24, 23, "Aaa Aaa O0 00:00:00 0000"}, /* BSD/ISO C90 ctime */
{28, 27, "Aaa Aaa O0 00:00:00 AAA 0000"}, /* BSD tmz */
{21, 20, "Aaa Aaa O0 00:00 0000"}, /* SysV ctime */
{25, 24, "Aaa Aaa O0 00:00 AAA 0000"}, /* SysV tmz */
/* RFC 822-alike From_ lines do not conform to RFC 4155, but seem to be
used
* in the wild (by UW-imap) */
{30, 29, "Aaa Aaa O0 00:00:00 0000 +0000"},
/* RFC 822 with zone spec; 1. military, 2. UT, 3. north america time
* zone strings; note that 1. is strictly speaking not correct as some
* letters are not used, and 2. is not because only "UT" is defined */
#define __reuse "Aaa Aaa O0 00:00:00 0000 AAA"
{28 - 2, 27 - 2, __reuse},
{28 - 1, 27 - 1, __reuse},
{28 - 0, 27 - 0, __reuse},
{0, 0, NULL}
};
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)