[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <36ca99e90810310645i23fb93ddmdbe93f65905a2f80@mail.gmail.com>
Date: Fri, 31 Oct 2008 14:45:55 +0100
From: "Bert Wesarg" <bert.wesarg@...glemail.com>
To: "Johannes Berg" <johannes@...solutions.net>
Cc: "Jörn Engel" <joern@...fs.org>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC] B+Tree library
On Fri, Oct 31, 2008 at 14:16, Johannes Berg <johannes@...solutions.net> wrote:
>
>> +static inline size_t btree_visitorl(struct btree_headl *head, long opaque,
>> + visitorl_t func2)
>> +{
>> + return btree_visitor(&head->h, &btree_geo32, opaque, visitorl, func2);
>> +}
>
> Incidentally, do you think it would be possible to implement a kind of
>
> btree_for_each_entry(e, ...) {
> do something with e
> }
#define btree_for_each_entryl(__elem, __head, __opaque, ...) \
({ \
void f2(void *__elem, long opaque, unsigned long key, size_t index) \
{ \
(__VA_ARGS__); \
} \
btree_visitorl(__head, __opaque, f2); \
});
usage:
btree_for_each_entryl(e, head, opaque, {
do something with e
})
looks strange but works.
Bert
>
> macro or function/macro combination? You seem to be doing a recursive
> walk across the tree, would it be useful to have a linked list at the
> lowest level of nodes to be able to iterate more easily?
>
> johannes
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists