File: queue.h

package info (click to toggle)
graywolf 0.1.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,424 kB
  • sloc: ansic: 84,358; sh: 216; awk: 36; makefile: 22
file content (70 lines) | stat: -rw-r--r-- 1,692 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* ----------------------------------------------------------------- 
"@(#) queue.h version 1.4 10/9/90"
FILE:	    queue.h                                       
DESCRIPTION:Insert file for queue library routines.
DATE:	    Mar 16, 1989 
REVISIONS:  
----------------------------------------------------------------- */
#ifndef QUEUE_H
#define QUEUE_H

#include <yalecad/base.h>

/* *********** data structures *************** */
typedef struct yqueue_info {
    char              *data ;
    struct yqueue_info *next ;
} YQUEUEBOX, *YQUEUEPTR  ;

typedef struct {
    YQUEUEPTR  top_of_queue ;
    YQUEUEPTR  bot_of_queue ;
} YQUEUE ;

/* *********** FIFO routines *************** */
extern void YinitQueue( P2(YQUEUE *queue, char *node ) ) ;
/* 
Arguments:
    YQUEUE *queue ;
    char *node ;
Function:
    Initialization of the queue handler (FIFO) for a given queue.  User
    supplies a pointer to the data that should be stored in queue.
*/

extern char *YtopQueue( P1(YQUEUE *queue ) ) ;
/* 
Arguments:
    YQUEUE *queue ;
Function:
    Returns the users pointer to the first element in the FIFO.
*/

extern void Yadd2Queue( P2(YQUEUE *queue, char *node ) ) ;
/* 
Arguments:
    YQUEUE *queue ;
    char *node ;
Function:
    Add a new element to the end of the queue.
*/

/* check status of the queue */
extern YQUEUEPTR YqueueNotEmpty( P1(YQUEUE *queue ) ) ;
/* 
Arguments:
    YQUEUE *queue ;
Function:
    Returns the QUEUEPTR if queue is not empty. NULL otherwise.
*/

/* debug function to dump the contents of the queue */
extern void YdumpQueue( P1(YQUEUE *queue ) ) ;
/* 
Arguments:
    YQUEUE *queue ;
Function:
    Debug function for queue handler.
*/

#endif /* QUEUE_H */