summaryrefslogtreecommitdiff
path: root/include/mailutils/msgset.h
blob: 901ea79c65c94341478e520c4ac5d65444a4752e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* GNU Mailutils -- a suite of utilities for electronic mail
   Copyright (C) 2011 Free Software Foundation, Inc.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 3 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General
   Public License along with this library.  If not, see
   <http://www.gnu.org/licenses/>. */

#ifndef _MAILUTILS_MSGSET_H
#define _MAILUTILS_MSGSET_H

#ifdef __cplusplus
extern "C" {
#endif

struct mu_msgrange
{
  size_t msg_beg;
  size_t msg_end;
};

/* Message numbers start with 1.  MU_MSGNO_LAST denotes the last
   message. */
#define MU_MSGNO_LAST   0
  
#define MU_MSGSET_UID   0x01   /* Message set operates on UIDs */
  
int mu_msgset_create (mu_msgset_t *pmsgset, mu_mailbox_t mbox, int flags);
int mu_msgset_get_list (mu_msgset_t msgset, mu_list_t *plist);
int mu_msgset_get_iterator (mu_msgset_t msgset, mu_iterator_t *pitr);

int mu_msgset_add_range (mu_msgset_t list, size_t beg, size_t end);
int mu_msgset_sub_range (mu_msgset_t list, size_t beg, size_t end);
  /*int mu_msgset_add_set (mu_msgset_t a, mu_msgset_t b);*/
  /*int mu_msgset_sub_set (mu_msgset_t a, mu_msgset_t b);*/
int mu_msgset_aggregate (mu_msgset_t set);
int mu_msgset_clear (mu_msgset_t set);
void mu_msgset_free (mu_msgset_t set);
void mu_msgset_destroy (mu_msgset_t *set);
  
int mu_msgset_parse_imap (mu_msgset_t set, char *s, char **end);

int mu_msgset_print (mu_stream_t str, mu_msgset_t msgset);
  
int mu_msgset_locate (mu_msgset_t msgset, size_t n,
		      struct mu_msgrange const **prange);
  
#ifdef __cplusplus
}
#endif

#endif

Return to:

Send suggestions and report system problems to the System administrator.