queue.h
890 Bytes
/*
* Copyright (C) 1998 by the Board of Trustees
* of Leland Stanford Junior University.
* Copyright (C) 1998 Digital Equipment Corporation
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef _QUEUE_H_
#define _QUEUE_H_
/* Routines to implement generic queues */
#include <stddef.h>
/* Define queue node types. All queues are assumed to have a head node.
* An empty queue must be initialized so that its next and prev
* point to the head node
*/
typedef struct qnode_t {
struct qnode_t *next;
struct qnode_t *prev;
} qnode_t, *qnode_ptr;
/* Memory management function prototypes */
qnode_ptr new_item (void *free_item_ptr, size_t item_size, char *name);
qnode_ptr new_zitem (void *free_item_ptr, size_t item_size, char *name);
void free_item (void *free_item_ptr, void *item_ptr);
#endif /* _QUEUE_H_ */