88 lines
1.8 KiB
C
88 lines
1.8 KiB
C
#ifndef _NZG_IFACE
|
|
#define _NZG_IFACE 1
|
|
|
|
#include "global.h"
|
|
|
|
typedef enum { true=1, false=0} bool;
|
|
|
|
typedef char msgSpaceId[MSGSPACE_ID_LEN];
|
|
|
|
typedef char msgSpaceListId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgSpaceListSemId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgSpaceListElemId[4*MSGSPACE_ID_LEN];
|
|
|
|
typedef char msgPoolDataTabId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgPoolDataTabSemId[4*MSGSPACE_ID_LEN];
|
|
|
|
typedef char msgBufferInfoTabId[4*MSGSPACE_ID_LEN];
|
|
|
|
typedef char msgPoolId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgPoolSemId[4*MSGSPACE_ID_LEN];
|
|
|
|
typedef char msgQueueDataId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgQueueId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgQueueElemId[4*MSGSPACE_ID_LEN];
|
|
typedef char msgQueueSemId[4*MSGSPACE_ID_LEN];
|
|
|
|
/* pid[] */
|
|
/* liste des processus demandeurs */
|
|
typedef struct MsgPool {
|
|
int bufferSize;
|
|
int bufferNb;
|
|
} msgPool;
|
|
|
|
typedef struct MsgBufferInfo {
|
|
pid_t ownerPid;
|
|
void * addr;
|
|
} msgBufferInfo;
|
|
|
|
typedef struct MsgPoolData {
|
|
msgPoolId poolId;
|
|
msgBufferInfoTabId bufferInfoTabId;
|
|
int bufferNb;
|
|
int bufferSize;
|
|
int allocDispBuffer;
|
|
} msgPoolData;
|
|
|
|
/* TODO: queueId */
|
|
|
|
|
|
typedef struct MsgSpace {
|
|
msgSpaceId id;
|
|
msgSpaceId externId;
|
|
int poolNb;
|
|
int queueNb;
|
|
int pid;
|
|
msgPoolDataTabId poolDataTabId;
|
|
msgPoolDataTabSemId poolDataTabSemId;
|
|
} msgSpace;
|
|
|
|
|
|
typedef struct MsgSpaceListElem {
|
|
int ownerPid;
|
|
msgSpaceId spaceId;
|
|
msgSpaceListElemId next;
|
|
} msgSpaceListElem;
|
|
|
|
typedef struct MsgSpaceList {
|
|
int elemCounter;
|
|
msgSpaceListElemId first;
|
|
msgSpaceListElemId last;
|
|
} msgSpaceList;
|
|
|
|
typedef struct MsgQueueElem {
|
|
msgQueueElemId id;
|
|
int poolIndex;
|
|
int bufferIndex;
|
|
msgQueueElemId next;
|
|
} msgQueueElem;
|
|
|
|
typedef struct MsgQueue {
|
|
msgQueueId id;
|
|
int elemCounter;
|
|
msgQueueElemId headId;
|
|
msgQueueElemId tailId;
|
|
} msgQueue;
|
|
|
|
#endif
|
|
/* */
|