diff --git a/src/get.c b/src/get.c index 37ea6ef..aa8637b 100644 --- a/src/get.c +++ b/src/get.c @@ -27,8 +27,11 @@ void * msgGet(msgSpace * space,int queueIndex,int option){ msgQueueElemId oldElemId; // recupérer l'id de l'ancien element... - msgQueueElemRem(queue, oldElemId); + msgQueueRem(queue, oldElemId); + msgQueueElem * oldElem; + oldElem = msgQueueElemOpen(oldElemId); + // fermer la file msgQueueClose(queue); diff --git a/src/proto.h b/src/proto.h index 417f466..1cf03c8 100644 --- a/src/proto.h +++ b/src/proto.h @@ -49,7 +49,7 @@ int msgPoolDelete(msgSpaceId spaceId, int poolIdx); /* put.c */ int msgPut(msgSpace *space, int queueIndex, void *addr); /* queueAdd.c */ -int msgQueueElemAdd(msgQueue *queue, msgQueueElemId newElemId); +int msgQueueAdd(msgQueue *queue, msgQueueElemId newElemId); /* queueClose.c */ int msgQueueClose(msgQueue *queue); /* queueDelete.c */ @@ -77,7 +77,7 @@ int msgQueueReadTryLock(msgSpaceId externId, int queueIdx); /* queueReadUnlock.c */ int msgQueueReadUnlock(msgSpaceId externId, int queueIdx); /* queueRem.c */ -int msgQueueElemRem(msgQueue *queue, msgQueueElemId oldElemId); +int msgQueueRem(msgQueue *queue, msgQueueElemId oldElemId); /* spaceCreate.c */ msgSpace *msgSpaceCreate(msgSpaceId externId, int queueNb, int poolNb, msgPool *poolInfos); /* spaceDelete.c */ diff --git a/src/queueAdd.c b/src/queueAdd.c index 6b1e807..5e3758b 100644 --- a/src/queueAdd.c +++ b/src/queueAdd.c @@ -2,7 +2,7 @@ // on ajoute en fin de queue... -int msgQueueElemAdd(msgQueue * queue, msgQueueElemId newElemId){ +int msgQueueAdd(msgQueue * queue, msgQueueElemId newElemId){ msgQueueElem * queueOldTailElem; msgQueueElem * queueNewTailElem; @@ -19,7 +19,8 @@ int msgQueueElemAdd(msgQueue * queue, msgQueueElemId newElemId){ } /* TODO: verifier si la liste n'est pas vide... */ - if((queue->headId = queue->id) && (queue->tailId = queue->id)) { + if((strcmp(queue->headId,queue->id)==0) + && (strcmp(queue->tailId,queue->id)==0)) { NZG_ERROR("msgQueueAdd",queue->id); goto ERROR; } diff --git a/src/queueRem.c b/src/queueRem.c index ab56c59..d526b51 100644 --- a/src/queueRem.c +++ b/src/queueRem.c @@ -2,7 +2,7 @@ // l'id de l'element enlevé vas dans oldElemId -int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){ +int msgQueueRem(msgQueue * queue, msgQueueElemId oldElemId){ msgQueueElem * queueOldHeadElem;