queue.h
来自「一个用在mips体系结构中的操作系统」· C头文件 代码 · 共 47 行
H
47 行
/* * Copyright (C) 1996-1998 by the Board of Trustees * of Leland Stanford Junior University. * * This file is part of the SimOS distribution. * See LICENSE file for terms of the license. * *//* @TITLE "queue.h: queue data structure"*//* * queue: this is a normal FIFO queue module, with a fixed maximum capacity. * * David Kotz 1994 *//* $Id: queue.h,v 1.4 1998/02/10 00:36:49 bosch Exp $ */#ifndef QUEUE_H#define QUEUE_Htypedef void *Qitem; /* a queue item is any pointer *//* ******************************************************* *//* CYCLE-COUNTED versions (only usable in USER mode) */typedef struct queue_s QUEUE; /* Queue handle */extern QUEUE *MakeQueue(int size, char *debugname); /* make a new queue */extern void Enqueue(QUEUE *q, Qitem item);extern void Dequeue(QUEUE *q, Qitem *item);extern int InQueue(QUEUE *q); /* number currently in queue */extern boolean EmptyQueue(QUEUE *q); /* TRUE if queue is empty */extern void FreeQueue(QUEUE *q); /* destroy a queue *//* ******************************************************* *//* NON-CYCLE-COUNTED versions (also useful in ENGINE mode) */typedef struct queue_noncyc_s NCQUEUE; /* Queue handle */extern NCQUEUE *MakeQueue_noncyc(int size, char *debugname); /* new queue */extern void Enqueue_noncyc(NCQUEUE *q, Qitem item);extern void Dequeue_noncyc(NCQUEUE *q, Qitem *item);extern int InQueue_noncyc(NCQUEUE *q); /* number currently in queue */extern boolean EmptyQueue_noncyc(NCQUEUE *q); /* TRUE if queue is empty */extern void FreeQueue_noncyc(NCQUEUE *q); /* destroy a queue */#endif /* QUEUE_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?