Using BSD queue.h for linked lists
Derek Atkins
warlord at MIT.EDU
Tue May 29 09:55:33 EDT 2012
ghudson at MIT.EDU writes:
[snip]
> If we were to go in this direction, we'd probably make a copy of the
> latest NetBSD version of the header in include/k5-queue.h, and
> recommend that it be used for even simple lists. For illustration,
> here are some fragments showing how it could be used in the lookaside
> cache:
>
> struct entry {
> LIST_ENTRY(entry) bucket_links;
> TAILQ_ENTRY(entry) expire_links;
> int num_hits;
> [... other field ...]
> };
>
> LIST_HEAD(entry_list, entry);
> TAILQ_HEAD(entry_queue, entry);
[snip]
> Does this seem like a reasonable direction?
Wouldn't this make including Krb5 headers with the system-level queue.h
problematic due to double-definition of macros?
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the krbdev
mailing list