mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-05 21:11:53 +00:00
MINOR: lists: Implement function to convert list => mt_list and mt_list => list
Implement mt_list_to_list() and list_to_mt_list(), to be able to convert from a struct list to a struct mt_list, and vice versa. This is normally of no use, except for struct connection's list field, that can go in either a struct list or a struct mt_list.
This commit is contained in:
parent
49983a9fe1
commit
751e5e21a9
@ -662,4 +662,28 @@ struct cond_wordlist {
|
||||
} \
|
||||
}), \
|
||||
&item->member != (list_head);)
|
||||
|
||||
static __inline struct list *mt_list_to_list(struct mt_list *list)
|
||||
{
|
||||
union {
|
||||
struct mt_list *mt_list;
|
||||
struct list *list;
|
||||
} mylist;
|
||||
|
||||
mylist.mt_list = list;
|
||||
return mylist.list;
|
||||
}
|
||||
|
||||
static __inline struct mt_list *list_to_mt_list(struct list *list)
|
||||
{
|
||||
union {
|
||||
struct mt_list *mt_list;
|
||||
struct list *list;
|
||||
} mylist;
|
||||
|
||||
mylist.list = list;
|
||||
return mylist.mt_list;
|
||||
|
||||
}
|
||||
|
||||
#endif /* _COMMON_MINI_CLIST_H */
|
||||
|
Loading…
Reference in New Issue
Block a user