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
2ddc6851
...
2ddc68512560f42f9a7a18c50cb9f48d9312a9c8
authored
2003-10-10 02:04:28 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
list.c
new function list_to_create
1 parent
7d2d7ecf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
mailbox/list.c
mailbox/list.c
View file @
2ddc685
...
...
@@ -303,3 +303,24 @@ list_set_destroy_item (list_t list, void (*destroy_item)(void *item))
return
EINVAL
;
list
->
destroy_item
=
destroy_item
;
}
int
list_to_array
(
list_t
list
,
void
**
array
,
size_t
count
,
size_t
*
pcount
)
{
size_t
total
=
0
;
if
(
list
!=
NULL
)
{
size_t
i
;
struct
list_data
*
current
;
total
=
(
count
<
list
->
count
)
?
count
:
list
->
count
;
for
(
i
=
0
,
current
=
list
->
head
.
next
;
i
<
total
&&
current
!=
&
(
list
->
head
);
current
=
current
->
next
)
{
if
(
array
)
array
[
i
]
=
current
->
item
;
}
}
if
(
pcount
)
*
pcount
=
total
;
return
0
;
}
...
...
Please
register
or
sign in
to post a comment