bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: decode in mail


From: Sergey Poznyakoff
Subject: Re: decode in mail
Date: Mon, 06 Aug 2001 20:33:53 +0300

Bonjour,

Returning to our discussion about message sets :^)
I have commited some changes regarding this topic. They follow
the scheme we have outlined in our discussion. The message sets
are represented by a structure:

  typedef struct message_set
  {
    msgset_t *next;    /* Link to the next message set */
    int npart;         /* Number of parts in this set */
    int *msg_part;     /* Array of part numbers: msg_part[0] is the message
                          number, subsequent slots keep part numbers. */
  }
  msgset_t;

Function msgset_parse() parses the message/part specification in the
form we have discussed and produces a singly-linked list of msgset_t
structures. Each element in the list represents a single message
(or a message part), so no need for recursion occurs. For example, the
following specification (which is, surely, absurdly complex ^:)

        1-2 [3-4, 5 [4 [(3,4) [4-8], 5, 7-11 ]]]

produces the list whose elements contain the following in their msg_part
member (dot separates message number from part numbers):

 (1 . '())
 (2 . (3))
 (2 . (4))
 (2 . (5 4 3 4))
 (2 . (5 4 3 5))
 (2 . (5 4 3 6))
 (2 . (5 4 3 7))
 (2 . (5 4 3 8))
 (2 . (5 4 4 4))
 (2 . (5 4 4 5))
 (2 . (5 4 4 6))
 (2 . (5 4 4 7))
 (2 . (5 4 4 8))
 (2 . (5 4 5))
 (2 . (5 4 7))
 (2 . (5 4 8))
 (2 . (5 4 9))
 (2 . (5 4 10))
 (2 . (5 4 11)))

(grasp)

A function util_msgset_iterate() can be used to iterate over the message
set, calling specified function at each node:

void util_msgset_iterate (msgset_t *msgset,
                          int (*fun)(message_t, msgset_t *, void*),
                          void *closure);

When "fun" is called, it is passed the requested message (or message part),
a pointer to corresponding message_t structure and a pointer to any
function-specific data ('closure').

There are some more questions to the message specifications:

1. An arbitrary string in the message spec is taken to mean the match on
sender's name. Still this search is not done, because as the comment in the
original util_expand_msglist() stated:
          /* FIXME: all messages from sender argv[i] */
          /* Annoying we can use address_create() for that
             but to compare against what? The email ?  */

Really, what should we compare it against?

2. A /../ specification (match on the subject line) simply does an
strstr comparison. What if we implement regexps?

-Sergey

PS: How is it with libmu_scm? 








reply via email to

[Prev in Thread] Current Thread [Next in Thread]