process.h

Go to the documentation of this file.
00001 /*******************************************************************\
00002 
00003                    SESAME project software license
00004 
00005               Copyright (C) 2002 University of Amsterdam
00006 
00007     This program is free software; you can redistribute it and/or
00008      modify it under the terms of the GNU General Public License
00009     as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015              GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018      along with this program; if not, write to the Free Software
00019       Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020                            02111-1307, USA.
00021 
00022       For information regarding the SESAME software project see
00023               http://sesamesim.sourceforge.net or email
00024                     jcofflan@users.sourceforge.net
00025 
00026 \*******************************************************************/
00027 
00028 /*
00029  *                        Pearl Compiler (c) 1989 University of Amsterdam
00030  *                                  by
00031  *                      B.J. Overeinder & J.G. Stil
00032  */
00033 
00034 
00035 #ifndef  PROCESS_H
00036 #define  PROCESS_H
00037 
00038 #include "message.h"
00039 
00040 typedef int (*function)();
00041 
00042 #define MAXIDLELEN 5
00043 #define MAXBUSYLEN 5
00044 
00045 typedef unsigned int timet;
00046 
00047 typedef struct mesg_q {
00048    int method_id;
00049    messx *mlist, *mtail;
00050 } mesg_q;
00051 
00052 
00053 /*
00054  * Description of the entries in the process table, i.e. the class instances.
00055  */
00056 typedef struct processx {
00057   char              *name;
00058   function          func;
00059   int               state;
00060   timet             time;
00061   int               *env;
00062   int               *sp;
00063   int               *mask;
00064   mesg_q            *mqs;             // hashtable of message-slots
00065   int               mqsize;           // size of hashtable
00066   int               mq_fs;            // number of non-free (full) slots
00067   unsigned int      seq_nr, flip_nr;
00068   struct processx   *next;
00069   char              *className;
00070   int               classIdx;
00071   int               mql;
00072   void              *ymlNode;
00073   int               last_dest;        // pid of object last sent a message
00074   int               last_method;      // method id of that object
00075   int               reply_wait;       // 1 if waiting for a reply
00076   int               stats_state;      // State to force statistics
00077   int               last_caller;      // pid of sender of last message recieved
00078 } processx;
00079 
00080 /*
00081  * States
00082  */
00083 #define  TIME           1
00084 #define  RECV           2
00085 #define  TIME_RECV      (TIME | RECV)
00086 #define  READY          4
00087 #define  NONEXISTING    8
00088 
00089 #endif //  PROCESS_H

Generated on Wed Apr 5 20:57:45 2006 for Sesame by  doxygen 1.4.6