Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4dc61069
Commit
4dc61069
authored
Jan 22, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wine/list.h: Add list_count function. Make some parameters const.
parent
4ae5b9fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
list.h
include/wine/list.h
+14
-5
No files found.
include/wine/list.h
View file @
4dc61069
...
...
@@ -100,7 +100,7 @@ inline static void list_remove( struct list *elem )
}
/* get the next element */
inline
static
struct
list
*
list_next
(
struct
list
*
list
,
struct
list
*
elem
)
inline
static
struct
list
*
list_next
(
const
struct
list
*
list
,
const
struct
list
*
elem
)
{
struct
list
*
ret
=
elem
->
next
;
if
(
elem
->
next
==
list
)
ret
=
NULL
;
...
...
@@ -108,7 +108,7 @@ inline static struct list *list_next( struct list *list, struct list *elem )
}
/* get the previous element */
inline
static
struct
list
*
list_prev
(
struct
list
*
list
,
struct
list
*
elem
)
inline
static
struct
list
*
list_prev
(
const
struct
list
*
list
,
const
struct
list
*
elem
)
{
struct
list
*
ret
=
elem
->
prev
;
if
(
elem
->
prev
==
list
)
ret
=
NULL
;
...
...
@@ -116,19 +116,19 @@ inline static struct list *list_prev( struct list *list, struct list *elem )
}
/* get the first element */
inline
static
struct
list
*
list_head
(
struct
list
*
list
)
inline
static
struct
list
*
list_head
(
const
struct
list
*
list
)
{
return
list_next
(
list
,
list
);
}
/* get the last element */
inline
static
struct
list
*
list_tail
(
struct
list
*
list
)
inline
static
struct
list
*
list_tail
(
const
struct
list
*
list
)
{
return
list_prev
(
list
,
list
);
}
/* check if a list is empty */
inline
static
int
list_empty
(
struct
list
*
list
)
inline
static
int
list_empty
(
const
struct
list
*
list
)
{
return
list
->
next
==
list
;
}
...
...
@@ -139,6 +139,15 @@ inline static void list_init( struct list *list )
list
->
next
=
list
->
prev
=
list
;
}
/* count the elements of a list */
inline
static
unsigned
int
list_count
(
const
struct
list
*
list
)
{
unsigned
count
=
0
;
const
struct
list
*
ptr
;
for
(
ptr
=
list
->
next
;
ptr
!=
list
;
ptr
=
ptr
->
next
)
count
++
;
return
count
;
}
/* move all elements from src to the tail of dst */
inline
static
void
list_move_tail
(
struct
list
*
dst
,
struct
list
*
src
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment