home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!caen!uakari.primate.wisc.edu!tik.vtt.fi!tml
- From: tml@tik.vtt.fi (Tor Lillqvist)
- Newsgroups: comp.sys.hp
- Subject: Re: remque, insque source code?
- Message-ID: <TML.92Aug20092530@hemuli.tik.vtt.fi>
- Date: 20 Aug 92 09:25:30 GMT
- References: <2845@tivoli.UUCP>
- Sender: news@tik.vtt.fi (USENET)
- Organization: Technical Research Centre of Finland, Laboratory for Information
- Processing (VTT/TIK)
- Lines: 40
- In-Reply-To: stuart@TIVOLI.COM's message of 19 Aug 92 21:39:56 GMT
-
- In article <2845@tivoli.UUCP> stuart@TIVOLI.COM (Stuart Jarriel) writes:
- Does anyone know of a public source for remque/insque?
-
- Here you are: (from X11R5/mit/lib/Berk/Berklib.c)
-
- #ifdef WANT_QUE
- struct qelem {
- struct qelem *q_forw;
- struct qelem *q_back;
- char *q_data;
- };
-
- insque(elem, pred)
- register struct qelem *elem, *pred;
- {
- register struct qelem *q;
- /* Insert locking code here */
- if ( elem->q_forw = q = (pred ? pred->q_forw : pred) )
- q->q_back = elem;
- if ( elem->q_back = pred )
- pred->q_forw = elem;
- /* Insert unlocking code here */
- }
-
- remque(elem)
- register struct qelem *elem;
- {
- register struct qelem *q;
- if ( ! elem ) return;
- /* Insert locking code here */
-
- if ( q = elem->q_back ) q->q_forw = elem->q_forw;
- if ( q = elem->q_forw ) q->q_back = elem->q_back;
-
- /* insert unlocking code here */
- }
- #endif /* WANT_QUE */
- --
- Tor Lillqvist,
- working, but not speaking, for the Technical Research Centre of Finland
-