*** empty log message ***
This commit is contained in:
parent
235c778aef
commit
13fe3a77d1
3 changed files with 41 additions and 6 deletions
|
@ -27,29 +27,33 @@ int msgPoolDataIdIntern(msgPoolDataTabId dest, const msgSpaceId src);
|
||||||
int msgPoolIdIntern(msgPoolId dest, msgPoolId src, int num);
|
int msgPoolIdIntern(msgPoolId dest, msgPoolId src, int num);
|
||||||
int msgBufferInfoTabIdIntern(msgBufferInfoTabId dest, msgSpaceId src, int num);
|
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 msgQueueElemIdIntern(msgQueueElemId dest, msgQueueId src, int counter);
|
||||||
/* 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);
|
||||||
/* poolDelete.c */
|
/* poolDelete.c */
|
||||||
int msgPoolDelete(msgSpaceId spaceId, int poolIdx);
|
int msgPoolDelete(msgSpaceId spaceId, int poolIdx);
|
||||||
/* queueAdd.c */
|
/* queueAdd.c */
|
||||||
/* queueAddElem.c */
|
int msgQueueElemAdd(msgQueue *queue, msgQueueElemId newElemId);
|
||||||
/* queueClose.c */
|
/* queueClose.c */
|
||||||
int msgQueueClose(msgQueue *queue);
|
int msgQueueClose(msgQueue *queue);
|
||||||
/* queueDelete.c */
|
/* queueDelete.c */
|
||||||
int msgQueueElemDelete(msgQueueElemId queueElemId);
|
int msgQueueElemDelete(msgQueueElemId queueElemId);
|
||||||
/* queueElemClose.c */
|
/* queueElemClose.c */
|
||||||
int msgQueueElemClose(msgQueueElem *queueElem);
|
int msgQueueElemClose(msgQueueElem *queueElem);
|
||||||
|
/* queueElemCreate.c */
|
||||||
|
int msgQueueElemCreate(msgQueueElemId finalQueueElemId, msgQueueId queueId, int counter);
|
||||||
/* queueElemDelete.c */
|
/* queueElemDelete.c */
|
||||||
int msgQueueElemDelete(msgQueueElemId queueElemId);
|
int msgQueueElemDelete(msgQueueElemId queueElemId);
|
||||||
/* queueElemOpen.c */
|
/* queueElemOpen.c */
|
||||||
void *msgQueueElemOpen(msgQueueElemId queueElemId);
|
void *msgQueueElemOpen(msgQueueElemId queueElemId);
|
||||||
/* queueInit.c */
|
/* queueInit.c */
|
||||||
|
msgQueue *queueInit(msgSpaceId externId, int queueIdx);
|
||||||
/* queueLock.c */
|
/* queueLock.c */
|
||||||
int queueLock(msgSpaceId externId, int queueIdx);
|
int queueLock(msgSpaceId externId, int queueIdx);
|
||||||
/* queueOpen.c */
|
/* queueOpen.c */
|
||||||
void *msgQueueOpen(msgQueueId queueId);
|
void *msgQueueOpen(msgQueueId queueId);
|
||||||
/* queueRemElem.c */
|
|
||||||
/* queueUnlock.c */
|
/* queueUnlock.c */
|
||||||
int queueUnlock(msgSpaceId externId, int queueIdx);
|
int queueUnlock(msgSpaceId externId, int queueIdx);
|
||||||
/* spaceCreate.c */
|
/* spaceCreate.c */
|
||||||
|
|
|
@ -2,6 +2,37 @@
|
||||||
|
|
||||||
// on ajoute en fin de queue...
|
// on ajoute en fin de queue...
|
||||||
|
|
||||||
int msgQueueElemAdd(msgQueue * queue, msgQueueElemId){
|
int msgQueueElemAdd(msgQueue * queue, msgQueueElemId newElemId){
|
||||||
|
msgQueueElem * queueOldTailElem;
|
||||||
|
msgQueueElem * queueNewTailElem;
|
||||||
|
|
||||||
|
// on informe l'element qu'il est le dernier
|
||||||
|
queueNewTailElem=msgQueueElemOpen(newElemId);
|
||||||
|
if (queueNewTailElem == NULL){
|
||||||
|
NZG_ERROR("msgQueueElemOpen",newElemId);
|
||||||
|
goto ERROR;
|
||||||
|
}
|
||||||
|
strcpy(queueNewTailElem->next,newElemId);
|
||||||
|
if (msgQueueElemClose(queueNewTailElem)){
|
||||||
|
NZG_ERROR("msgQueueElemClose",newElemId);
|
||||||
|
goto ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: verifier si la liste n'est pas vide... */
|
||||||
|
/* on informe son prédecesseur qu'il a un suivant */
|
||||||
|
queueOldTailElem=msgQueueElemOpen(queue->tailId);
|
||||||
|
if (queueOldTailElem == NULL){
|
||||||
|
NZG_ERROR("msgQueueElemOpen",queue->tailId);
|
||||||
|
goto ERROR;
|
||||||
|
}
|
||||||
|
strcpy(queueOldTailElem->next,newElemId);
|
||||||
|
if (msgQueueElemClose(queueOldTailElem)){
|
||||||
|
NZG_ERROR("msgQueueElemClose",queue->tailId);
|
||||||
|
goto ERROR;
|
||||||
|
}
|
||||||
|
// on donne a la queue l'id du dernier element
|
||||||
|
strcpy(queue->tailId,newElemId);
|
||||||
|
|
||||||
|
ERROR:
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "libnazgul.h"
|
#include "libnazgul.h"
|
||||||
#include "ids.h"
|
#include "ids.h"
|
||||||
|
|
||||||
int msgQueueElemCreate(msgQueueElemId,
|
int msgQueueElemCreate(
|
||||||
finalQueueElemId,
|
msgQueueElemId finalQueueElemId ,
|
||||||
msgQueueId queueId,
|
msgQueueId queueId,
|
||||||
int counter){
|
int counter){
|
||||||
msgQueueElemId queueElemId;
|
msgQueueElemId queueElemId;
|
||||||
|
@ -24,7 +24,7 @@ int msgQueueElemCreate(msgQueueElemId,
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(queueElem_Fd);
|
close(queueElemFd);
|
||||||
return 0;
|
return 0;
|
||||||
ERROR:
|
ERROR:
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue