File: cque.h

package info (click to toggle)
audacity 1.2.4b-2.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 24,136 kB
  • ctags: 20,445
  • sloc: ansic: 139,567; cpp: 55,998; sh: 24,963; lisp: 3,772; makefile: 1,683; python: 272
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)