1 /* GNU Mailutils -- a suite of utilities for electronic mail
2    Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 3 of the License, or (at your option) any later version.
8 
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13 
14    You should have received a copy of the GNU Lesser General
15    Public License along with this library.  If not, see
16    <http://www.gnu.org/licenses/>. */
17 
18 #ifndef _MAILUTILS_SYS_ITERATOR_H
19 # define _MAILUTILS_SYS_ITERATOR_H
20 
21 # include <mailutils/iterator.h>
22 
23 # ifdef __cplusplus
24 extern "C" {
25 # endif
26 
27 struct _mu_iterator
28 {
29   struct _mu_iterator *next_itr; /* Next iterator in the chain */
30   void *owner;                /* Object whose contents is being iterated */
31   int is_advanced;            /* Is the iterator already advanced */
32 
33   int (*dup) (void **ptr, void *owner);
34   int (*destroy) (mu_iterator_t itr, void *owner);
35   int (*first) (void *owner);
36   int (*next) (void *owner);
37   int (*getitem) (void *owner, void **pret, const void **pkey);
38   int (*delitem) (void *owner, void *item);
39   int (*finished_p) (void *owner);
40   int (*itrctl) (void *owner, enum mu_itrctl_req req, void *arg);
41   void *(*dataptr) (void *);
42 };
43 
44 # ifdef __cplusplus
45 }
46 # endif
47 
48 #endif /* _MAILUTILS_SYS_ITERATOR_H */
49