File: cque.h

package info (click to toggle)
audacity 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 44,240 kB
  • sloc: cpp: 182,841; ansic: 120,375; sh: 26,421; lisp: 7,495; makefile: 1,606; python: 240; xml: 104; perl: 31
file content (25 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* 
 * cque.h
 * macros for free lists.
 */

typedef struct cque {
    struct cque	*qnext;
} CQUE;

#define	Qinit(q1)	{ (q1) = 0; }

/* q1 points to a stack CQUE*, new is an element to insert */
#define Qenter(q1,new)  {   \
    ((CQUE *)(new))->qnext = ((CQUE *)(q1)); \
    q1 = ((CQUE *)(new)); }


/* q1 points to a list of CQUE*: remove elt and assign to new */
/* NOTE: q1 must be non-empty */
#define Qget(q1,newtype,new) {  \
    (new) = (newtype)(q1);  \
    q1 = ((CQUE *)(q1))->qnext; }


#define	Qempty(q1)	((q1) == 0)