*** empty log message ***

This commit is contained in:
glenux 2004-02-24 08:57:52 +00:00
parent fa08b31c57
commit 3f9f6ead4a
4 changed files with 24 additions and 4 deletions

View file

@ -128,5 +128,19 @@ int msgQueueElemIdIntern(
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

View file

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

View file

@ -29,6 +29,7 @@ int msgBufferInfoTabIdIntern(msgBufferInfoTabId dest, msgSpaceId src, int num);
int msgQueueSemIdIntern(msgQueueSemId dest, msgSpaceId externId, int queueIdx);
int msgQueueIdIntern(msgQueueId dest, msgSpaceId externId, int queueIdx);
int msgQueueElemIdIntern(msgQueueElemId dest, msgQueueId src, int counter);
int spaceListElemIdIntern(msgSpaceListElemId elemListId, msgSpaceId externId);
/* list.c */
/* poolCreate.c */
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);
/* spaceListAdd.c */
/* spaceListElemCreate.c */
int msgSpaceListElemCreate(msgSpaceListElemId elemenListId, msgSpaceId spaceId);
int msgSpaceListElemCreate(msgSpaceListElemId elemenListId, msgSpace *space);
/* spaceListElemLink.c */
/* spaceListInit.c */
int msgSpaceListInit(void);

View file

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