Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
25d8229f
...
25d8229ffad5f3343a155d20e3a8c164d6dd65aa
authored
2003-08-21 16:20:29 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(iterator_dup): New function
1 parent
9192cc90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
include/mailutils/iterator.h
mailbox/iterator.c
include/mailutils/iterator.h
View file @
25d8229
...
...
@@ -25,6 +25,7 @@ extern "C" {
#endif
extern
int
iterator_create
__P
((
iterator_t
*
,
list_t
));
extern
int
iterator_dup
__P
((
iterator_t
*
piterator
,
iterator_t
orig
));
extern
void
iterator_destroy
__P
((
iterator_t
*
));
extern
int
iterator_first
__P
((
iterator_t
));
extern
int
iterator_next
__P
((
iterator_t
));
...
...
mailbox/iterator.c
View file @
25d8229
...
...
@@ -43,6 +43,25 @@ iterator_create (iterator_t *piterator, list_t list)
return
0
;
}
int
iterator_dup
(
iterator_t
*
piterator
,
iterator_t
orig
)
{
iterator_t
iterator
;
if
(
piterator
==
NULL
||
orig
==
NULL
)
return
EINVAL
;
iterator
=
calloc
(
sizeof
(
*
iterator
),
1
);
if
(
iterator
==
NULL
)
return
ENOMEM
;
iterator
->
list
=
orig
->
list
;
iterator
->
cur
=
orig
->
cur
;
iterator
->
is_advanced
=
orig
->
is_advanced
;
iterator
->
next
=
orig
->
list
->
itr
;
orig
->
list
->
itr
=
iterator
;
*
piterator
=
iterator
;
return
0
;
}
void
iterator_destroy
(
iterator_t
*
piterator
)
{
...
...
Please
register
or
sign in
to post a comment