From: Jeffrey C Honig Date: Mon, 11 Aug 2003 01:20:52 +0000 (+0000) Subject: When compiling format strings, nmh attempts to avoid multiple parsing X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/cafee7a804b8aa53166065e988ec0fc387862fc8?hp=cafee7a804b8aa53166065e988ec0fc387862fc8 When compiling format strings, nmh attempts to avoid multiple parsing of address and date fields by only inserting calls to the parse functions (FT_PARSEADDR and FT_PARSEDATE) for a given component once. The problem with this method is that the initial invocation may actually be on a code path that is conditionally executed. This can result cached copies of data from the fields in previous messages to be used. My solution is to move this optimization from compile time to run time. Address and Date parsing calls (FT_PARSEADDR and FT_PARSEDATE) will always be included. Run time flags are used to prevent these functions from being run more than once per component per message. The c_flags field has being converted from a boolean to a bit-field to facilitate maintenance of the new CT_PARSED value. The result value that used to be in this field is now the bit CF_TRUE and the overloaded use of this field by scan() is now the CT_DATEFAB bit. Some unneeded flags (CT_ADDRPARSE, CT_MYMBOX) have also been removed. ---