X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Finsque.c;h=fd02357bb23970dcda529f1f4a939074c07c54ad;hb=5f512a7dd0df1205630e9edfaa84f2e9a8fb8771;hp=775019f8fffc9bbd3bae8d04c1870d7e1caf190a;hpb=252b5132c753830d5fd56823373aed85f2a0db63;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/insque.c b/libiberty/insque.c index 775019f8ff..fd02357bb2 100644 --- a/libiberty/insque.c +++ b/libiberty/insque.c @@ -2,24 +2,28 @@ 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 +34,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 +44,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;