X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Finsque.c;h=3473bb92b31f91f6c55e5e8c1c23308f7b62e322;hb=c865e45b1b6d482d20b3f6096d5227216db0e451;hp=775019f8fffc9bbd3bae8d04c1870d7e1caf190a;hpb=d0352a18a504a4e7b761f6b3264cf11347d8d056;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/insque.c b/libiberty/insque.c index 775019f8ff..3473bb92b3 100644 --- a/libiberty/insque.c +++ b/libiberty/insque.c @@ -2,24 +2,27 @@ This file is in the public domain. */ /* -NAME - insque, remque -- insert, remove an element from a queue -SYNOPSIS - struct qelem { - struct qelem *q_forw; - struct qelem *q_back; - char q_data[]; - }; +@deftypefn Supplemental void insque (struct qelem *@var{elem}, struct qelem *@var{pred}) +@deftypefnx Supplemental void remque (struct qelem *@var{elem}) - void insque (struct qelem *elem, struct qelem *pred) +Routines to manipulate queues built from doubly linked lists. The +@code{insque} routine inserts @var{elem} in the queue immediately +after @var{pred}. The @code{remque} routine removes @var{elem} from +its containing queue. These routines expect to be passed pointers to +structures which have as their first members a forward pointer and a +back pointer, like this prototype (although no prototype is provided): - void remque (struct qelem *elem) +@example +struct qelem @{ + struct qelem *q_forw; + struct qelem *q_back; + char q_data[]; +@}; +@end example + +@end deftypefn -DESCRIPTION - Routines to manipulate queues built from doubly linked lists. - The insque routine inserts ELEM in the queue immediately after - PRED. The remque routine removes ELEM from its containing queue. */ @@ -30,9 +33,7 @@ struct qelem { void -insque (elem, pred) - struct qelem *elem; - struct qelem *pred; +insque (struct qelem *elem, struct qelem *pred) { elem -> q_forw = pred -> q_forw; pred -> q_forw -> q_back = elem; @@ -42,8 +43,7 @@ insque (elem, pred) void -remque (elem) - struct qelem *elem; +remque (struct qelem *elem) { elem -> q_forw -> q_back = elem -> q_back; elem -> q_back -> q_forw = elem -> q_forw;