Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STAILQ

39 views
Skip to first unread message

matt

unread,
Jul 18, 2000, 3:00:00 AM7/18/00
to
is there any opposition to bringing in some FreeBSD additions to
sys/queue.h that implement singly linked tailq's, along w/ a few other
random methods that we don't have?

from the manpage:

.Sh SINGLY-LINKED TAIL QUEUES
A singly-linked tail queue is headed by a structure defined by the
.Nm STAILQ_HEAD
macro.
This structure contains a pair of pointers,
one to the first element in the tail queue and the other to
the last element in the tail queue.
The elements are singly linked for minimum space and pointer
manipulation overhead at the expense of O(n) removal for arbitrary
elements.
New elements can be added to the tail queue after an existing element,
at the head of the tail queue, or at the end of the tail queue.

matt
--
matt debergalis <deb...@mit.edu> KB1CTH
http://www.mit.edu/~deberg/ for PGP key

Jason R Thorpe

unread,
Jul 18, 2000, 3:00:00 AM7/18/00
to
On Tue, Jul 18, 2000 at 06:43:52PM -0400, matt wrote:

> .Sh SINGLY-LINKED TAIL QUEUES
> A singly-linked tail queue is headed by a structure defined by the
> .Nm STAILQ_HEAD

In NetBSD, these are called SIMPLEQ.

--
-- Jason R. Thorpe <tho...@zembu.com>

matt

unread,
Jul 19, 2000, 3:00:00 AM7/19/00
to
matt> is there any opposition to bringing in some FreeBSD additions
matt> to sys/queue.h that implement singly linked tailq's, along w/
matt> a few other random methods that we don't have?

specifically, freebsd has *_FOREACH(var,head,field) defined for all of
its queue abstractions, and also {TAILQ,CIRCLEQ}_FOREACH_REVERSE().

the netsmb code for samba support uses a few of these.

Jason> In NetBSD, these are called SIMPLEQ.

it also uses STAILQ a lot, is it better to special case every call based
on __NetBSD__ and __FreeBSD__, or to hack a rename of the STAILQ to
SIMPLEQ for those files, or provide the STAILQ interface names as
another way to use our SIMPLEQ structure?

Paul A Vixie

unread,
Jul 19, 2000, 3:00:00 AM7/19/00
to
> Jason> In NetBSD, these are called SIMPLEQ.
>
> it also uses STAILQ a lot, is it better to special case every call based
> on __NetBSD__ and __FreeBSD__, or to hack a rename of the STAILQ to
> SIMPLEQ for those files, or provide the STAILQ interface names as
> another way to use our SIMPLEQ structure?

in places where different bsd's have different api's in name only, or in
minor things like parameter order or structure name, they should converge.

BSD 4.4 had something called a System Interface. perhaps Kirk could be
convinced to publish an updated version of it that both freebsd and netbsd
could conform to, whenever some API difference is a matter of style rather
than vision/scope?

Jaromír Doleček

unread,
Jul 19, 2000, 3:00:00 AM7/19/00
to
Paul A Vixie wrote:
> in places where different bsd's have different api's in name only, or in
> minor things like parameter order or structure name, they should converge.

Seconded.

> BSD 4.4 had something called a System Interface. perhaps Kirk could be
> convinced to publish an updated version of it that both freebsd and netbsd
> could conform to, whenever some API difference is a matter of style rather
> than vision/scope?

That would be really nice.

Jaromir
--
Jaromir Dolecek <jdol...@NetBSD.org> http://www.ics.muni.cz/~dolecek/
@@@@ Wanna a real operating system ? Go and get NetBSD, damn! @@@@

Bill Studenmund

unread,
Jul 19, 2000, 3:00:00 AM7/19/00
to
On 18 Jul 2000, matt wrote:

> matt> is there any opposition to bringing in some FreeBSD additions
> matt> to sys/queue.h that implement singly linked tailq's, along w/
> matt> a few other random methods that we don't have?
>
> specifically, freebsd has *_FOREACH(var,head,field) defined for all of
> its queue abstractions, and also {TAILQ,CIRCLEQ}_FOREACH_REVERSE().
>
> the netsmb code for samba support uses a few of these.

Those sound useful. :-)

Take care,

Bill


0 new messages