*** empty log message ***

This commit is contained in:
glenux 2004-02-24 08:57:52 +00:00 committed by Glenn Y. Rolland
parent 6ae954fe0f
commit d78d181ef5
4 changed files with 24 additions and 4 deletions

View file

@ -128,5 +128,19 @@ int msgQueueElemIdIntern(
return 0; return 0;
} }
int spaceListElemIdIntern(msgSpaceListElemId elemListId,msgSpaceId externId){
if (strlen(externId)>MSGSPACE_ID_LEN){
return -1;
}
/* sprintf(resNzgId,"/tmp/.nzg-%s",(char *)spaceId); */
#ifdef _NZG_REALFILEID
sprintf(elemListId,"/tmp/nzgSpaceListElem-%s",(char *)externId);
#else
sprintf(elemListId,"/nzgSpaceListElem-%s",(char *)externId);
#endif
return 0;
}
#endif #endif

View file

@ -60,6 +60,7 @@ typedef struct MsgSpace {
typedef struct MsgSpaceListElem { typedef struct MsgSpaceListElem {
int ownerPid; int ownerPid;
msgSpaceId spaceId;
msgSpaceListElemId next; msgSpaceListElemId next;
} msgSpaceListElem; } msgSpaceListElem;

View file

@ -29,6 +29,7 @@ int msgBufferInfoTabIdIntern(msgBufferInfoTabId dest, msgSpaceId src, int num);
int msgQueueSemIdIntern(msgQueueSemId dest, msgSpaceId externId, int queueIdx); int msgQueueSemIdIntern(msgQueueSemId dest, msgSpaceId externId, int queueIdx);
int msgQueueIdIntern(msgQueueId dest, msgSpaceId externId, int queueIdx); int msgQueueIdIntern(msgQueueId dest, msgSpaceId externId, int queueIdx);
int msgQueueElemIdIntern(msgQueueElemId dest, msgQueueId src, int counter); int msgQueueElemIdIntern(msgQueueElemId dest, msgQueueId src, int counter);
int spaceListElemIdIntern(msgSpaceListElemId elemListId, msgSpaceId externId);
/* list.c */ /* list.c */
/* poolCreate.c */ /* poolCreate.c */
int msgPoolCreate(msgSpaceId externId, int poolIdx, int buffNb, int buffSize); int msgPoolCreate(msgSpaceId externId, int poolIdx, int buffNb, int buffSize);
@ -73,7 +74,7 @@ msgSpace *msgSpaceCreate(msgSpaceId externId, int queueNb, int poolNb, msgPool *
int msgSpaceDelete(msgSpaceId externId); int msgSpaceDelete(msgSpaceId externId);
/* spaceListAdd.c */ /* spaceListAdd.c */
/* spaceListElemCreate.c */ /* spaceListElemCreate.c */
int msgSpaceListElemCreate(msgSpaceListElemId elemenListId, msgSpaceId spaceId); int msgSpaceListElemCreate(msgSpaceListElemId elemenListId, msgSpace *space);
/* spaceListElemLink.c */ /* spaceListElemLink.c */
/* spaceListInit.c */ /* spaceListInit.c */
int msgSpaceListInit(void); int msgSpaceListInit(void);

View file

@ -2,12 +2,13 @@
#include "ids.h" #include "ids.h"
// cree un nouvel elemen // cree un nouvel elemen
int msgSpaceListElemCreate(msgSpaceListElemId elemenListId,msgSpaceId spaceId){ int msgSpaceListElemCreate(msgSpaceListElemId elemenListId,msgSpace * space){
int shmElemenList; int shmElemenList;
/*Creation de lid pour lespace de message*/ /*Creation de lid pour lespace de message*/
spaceListElemIdIntern(elemenListId,spaceId); spaceListElemIdIntern(elemenListId,space->externId);
if ((shmElemenList=shm_open(elemenListId, if ((shmElemenList=shm_open(elemenListId,
@ -21,8 +22,11 @@ int msgSpaceListElemCreate(msgSpaceListElemId elemenListId,msgSpaceId spaceId){
NZG_ERROR("ftruncate",elemenListId); NZG_ERROR("ftruncate",elemenListId);
goto ERROR; goto ERROR;
}; };
close (shmElemenList); close (shmElemenList);
//TODO: mapper le shm en mémoire et remplir avec des informations
//strcpy(spaceListElem->spaceId,space->id);
return 0; return 0;
ERROR: ERROR:
return-1; return-1;