Main Page   File List  

queue.h

00001 /***************************************************************************
00002                           queue.h  -  description
00003                              -------------------
00004     begin                : Wed Jan 14 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : [email protected]
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018  #ifndef __QUEUE_H
00019  #define __QUEUE_H
00020 
00021   #include "ktypes.h"
00022   #include "proc.h"
00023   
00024   #define E_UNDERFLOW 0xBAD
00025   #define E_OVERFLOW  0xFAD
00026   #define E_EXISTS    0xCAD
00027   #define E_FAILURE   0xCAB
00028 
00029   typedef struct
00030   {
00031     DW front;
00032     DW end;
00033     DW q[MAX_PROC];
00034     DW max; //MAX_PROC
00035     DW n; //Current member count
00036   } QUEUE;
00037 
00038   extern QUEUE ready_q;
00039     
00040   void q_init(QUEUE *q_ptr);
00041   DW enq(QUEUE *q_ptr,DW pid);
00042   DW deq(QUEUE *q_ptr);
00043   DW remove(QUEUE *q_ptr, DW pid);
00044   void printQ(QUEUE *q_ptr);  
00045 
00046  #endif

Generated on Sun Jan 18 01:43:52 2004 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002
Hosted by www.Geocities.ws

1