nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] m_getfld

2012-12-11 20:39:13
Well, I'm not too concerned about the exact API for this as long as it's
reasonably doable.  Just seems to me that m_getfld is already scanning
the message, and MIME has made it so that one has to scan further in order
to get all of the "headers".  So it seems like a natural place for it.

So let me speak to this a bit, since I've done some recent work in this
space.

The big use of m_getfld() when processing the header of a message is looking
for particular headers; the way this is done is to iterate through all of
the headers and look for ones we care about.  This is either via a linked
list (in mhl) or searched through the format hash table.  Since we always
read the whole header, our hypothetical m_getfld() replacement should do
that as well and index those headers.  Also the code to populate the format
hash table would be useful as well, since that's repeated a lot (I made
that a bit better recently).

When reading the body, it occurs to me that the MIME parsing could be lazy.
For example, with scan we just care about the first text part.  If the
text part is later then that would suck, but most of the time it's first.
So we'd want a function to get the first text part.  Other than that ... well,
we need something to provide an index to a particular MIME part and provide
a stream-like handle into that part that does whatever decoding we need done.

So something like:

- nmh_read_header()
- nmh_first_text_part()
- something else which I haven't thought of yet.

--Ken



_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>