home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
unix
/
unixtools
/
util
/
h
/
queue
< prev
next >
Wrap
Text File
|
1992-07-21
|
925b
|
41 lines
/* > H.Queue - Queue data type header file */
#ifndef __queue_h
#define __queue_h
struct queue
{
void *head; /* pointer to head of queue */
void *tail; /* pointer to tail of queue */
int obj_size; /* size of one element */
};
typedef struct queue *queue;
/* General component routines */
queue Q_new (int obj_len);
void Q_free (queue q);
void Q_clear (queue q);
int Q_copy (queue q1, const queue q2);
int Q_equal (const queue q1, const queue q2);
int Q_empty (const queue q);
int Q_size (const queue q);
/* Iterator */
#define STATUS_CONTINUE 0 /* Continue processing */
#define STATUS_STOP 1 /* Stop processing */
#define STATUS_ERROR (-1) /* Error - terminate */
int Q_iterate (const queue q, int (*process)(void *));
/* Queue-specific routines */
int Q_add (queue q, const void *object);
int Q_remove (queue q);
void *Q_head (const queue q);
#endif