Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

bbd.h

Go to the documentation of this file.
00001 /****************************************************************************/
00002 /*  bbd.h
00003 
00004     5/13/93    murphy  commented out BBD_SOLE_READER, not implemented
00005    Jan 1 1992  murphy  created
00006 *****************************************************************************/
00007 
00008 #ifndef INC_BBD_H
00009 #define INC_BBD_H
00010 
00011 #include "vxWorks.h"
00012 #include "semLib.h"
00013 
00014 /* parameter defs */
00015 /*  bbd types */
00016 typedef enum
00017 {
00018   BBD_NULL = 0,
00019 /*  BBD_SOLE_READER = 1,  NOT implmented */
00020   BBD_MULT_READER = 2,
00021   BBD_SOLE_WRITER = 3,
00022   BBD_MULT_WRITER = 4
00023 }
00024 BBD_TYPE;
00025 
00026 /* read write types */
00027 typedef enum
00028 {
00029   BBD_PLAIN_READ = 1,
00030   BBD_FRESH_READ = 2,
00031   BBD_SPY_READ = 3
00032 }
00033 BBD_READ_TYPE;
00034 
00035 typedef enum
00036 {
00037   BBD_PLAIN_WRITE = 1,
00038   BBD_WAIT_WRITE = 2
00039 }
00040 BBD_WRITE_TYPE;
00041 
00042 typedef void *BBD;
00043 
00044 /* function declarations */
00045 #ifdef  __STDC__
00046 
00047 IMPORT BBD bbdConnect (char *bbdName, BBD_TYPE bbdType, int bbdSize);
00048 IMPORT STATUS bbdRead (BBD id, void *data, BBD_READ_TYPE readType,
00049                        int timeout);
00050 IMPORT STATUS bbdClear (BBD id);
00051 IMPORT STATUS bbdWrite (BBD id, void *data, BBD_WRITE_TYPE writeType, ...);
00052   /* If BBD_WRITE_TYPE == BBD_WAIT_WRITE, then last arg = timeout */
00053 IMPORT STATUS bbdDelete (BBD id);
00054 IMPORT char *bbdName (BBD id);
00055 IMPORT BBD bbdNameToId (char *name);
00056 IMPORT STATUS bbdShow (BBD id, char *name);
00057 
00058 #else
00059 
00060 IMPORT BBD bbdConnect ();
00061 IMPORT int bbdRead ();
00062 IMPORT int bbdClear ();
00063 IMPORT int bbdWrite ();
00064 IMPORT STATUS bbdDelete ();
00065 IMPORT char *bbdName ();
00066 IMPORT BBD bbdNameToId ();
00067 IMPORT int bbdShow ();
00068 
00069 #endif /* __STDC__ */
00070 
00071 /* bbd structures:  writer and reader */
00072 #define BBD_NAME_SIZE 100
00073 
00074 typedef struct bbdWriter
00075 {
00076   BBD_TYPE type;                /* BBD_SOLE_WRITER or BBD_MULT_WRITER */
00077   SEM_ID sem;                   /* semaphore for bbd */
00078   char name[BBD_NAME_SIZE];     /* name of the bulletin board */
00079   char *buf;                    /* pointer to data buffer */
00080   int size;                     /* size of data */
00081   int writeCnt;                 /* message count of current write */
00082   int readCnt;                  /* message count of last read */
00083   SEM_ID waitingToWriteSem;     /* sem: last data has been read */
00084   SEM_ID waitingToReadSem;      /* sem: new data has been writen.  Always
00085                                  * remains in the 'taken' state.  SemFlush
00086                                  * does not change the state. */
00087   int taskId;                   /* who has write priveledge */
00088   struct bbdReader *readers;    /* link to reader list */
00089   struct bbdWriter *next;       /* link to next bulletin board in list */
00090 }
00091 BBD_WRITER;
00092 
00093 typedef struct bbdReader
00094 {
00095   BBD_TYPE type;                /* BBD_SOLE_READER or BBD_MULT_READER */
00096   BBD_WRITER *bbd;              /* link to bulletin board structure */
00097   int readCnt;                  /* message count of last read */
00098   int taskId;                   /* task id of owner */
00099   struct bbdReader *next;       /* link to next reader in list */
00100 }
00101 BBD_READER;
00102 
00103 
00104 #endif
00105   /* INC_BBD_H */

Generated on Sun Dec 2 15:56:48 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001