/*****************************************
接口文件QUEUE.h
****************************************/
#ifndef _QUEUE_H
#define _QUEUE_H
#ifndef BOOL
#define BOOL int
#endif
typedef int Item;
struct _Queue;
typedef struct _Queue Queue;
typedef Queue* hQueue;//handle to Queue
hQueue Queue_Init(int nMax);
void Queue_Destroy(hQueue q);
void Queue_Put(hQueue q, Item elem);
Item Queue_Get(hQueue q);
int Queue_Size(hQueue q);
BOOL Queue_IsEmpty(hQueue q);
BOOL Queue_IsFull(hQueue q);
#endif
/*******************************
实现文件QUEUE.c
*******************************/
#include<stdio.h>
#include<stdlib.h>
#include"QUEUE.h"
void Error(char* msg)
{
printf("Error:%s",msg);