This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
Threads/queue.h
2020-06-24 13:51:34 +01:00

21 lines
487 B
C
Executable file

/* file: queue.h -- definitions for queue manipulation routines. */
#ifndef QUEUE_DEFINED
#define QUEUE_DEFINED
typedef struct qitem {
struct qitem *next; /* this must always be first; can cast to any struct with this first */
} Qitem;
typedef struct queue {
Qitem *front, *back;
} Queue;
int queue_init(Queue *q);
int queue_empty(Queue *q);
void queue_put(Queue *q, Qitem *new_item);
Qitem *queue_get(Queue *q);
#endif
/* end file: queue.h */