*** empty log message ***

This commit is contained in:
glenux 2004-02-26 07:36:00 +00:00
parent b2731cdafd
commit d24812f106
2 changed files with 32 additions and 20 deletions

View file

@ -30,7 +30,6 @@ int msgSpaceListFindId(msgSpaceId spaceId){
goto ERROR; goto ERROR;
} }
return 0; return 0;
}
ERROR: ERROR:
return -1; return -1;
} }
@ -40,8 +39,18 @@ int msgSpaceListElemFindId(msgSpaceListElemId elemId,msgSpaceId spaceId){
msgSpaceListElemId listElemIdNext; msgSpaceListElemId listElemIdNext;
msgSpaceId currentElemSpaceId; msgSpaceId currentElemSpaceId;
listElem=msgSpaceListElemOpen(elemId);
if (listElem==NULL){
NZG_ERROR("msgSpaceListElemOpen",elemId);
goto ERROR;
}
strcpy(listElemIdNext,listElem->next); strcpy(listElemIdNext,listElem->next);
strcpy(currentElemSpaceId,listElem->spaceId); strcpy(currentElemSpaceId,listElem->spaceId);
if (msgSpaceListElemClose(listElem) < 0){
NZG_ERROR("msgSpaceListElemClose",elemId);
goto ERROR;
}
printf("Current ListElem: Next:%s, Sid:%s\n", printf("Current ListElem: Next:%s, Sid:%s\n",
listElemIdNext,currentElemSpaceId); listElemIdNext,currentElemSpaceId);
printf("comparisons...\n"); printf("comparisons...\n");

View file

@ -7,6 +7,16 @@ int msgSpaceListRem(msgSpaceId spaceId){
msgSpaceListElemId listHeadElemId; msgSpaceListElemId listHeadElemId;
msgSpaceListElemId listTailElemId; msgSpaceListElemId listTailElemId;
msgSpaceListId listId; msgSpaceListId listId;
msgSpaceListElemId prevElemId;
msgSpaceListElemId currElemId;
msgSpaceListElemId nextElemId;
msgSpaceListElem * prevElem;
msgSpaceListElem * currElem;
msgSpaceListElem * nextElem;
msgSpaceId currSpaceId;
list=msgSpaceListOpen(); list=msgSpaceListOpen();
if (list==NULL){ if (list==NULL){
NZG_ERROR("msgSpaceListOpen",""); NZG_ERROR("msgSpaceListOpen","");
@ -23,32 +33,25 @@ int msgSpaceListRem(msgSpaceId spaceId){
return 1; return 1;
} else { } else {
bool found=false; bool found=false;
msgSpaceListElemId prevElemId;
msgSpaceListElemId currElemId;
msgSpaceListElemId nextElemId;
msgSpaceListElem prevElem;
msgSpaceListElem currElem;
msgSpaceListElem nextElem;
msgSpaceId currSpaceId;
strcpy(prevElemId,listHeadElemId,list->headId); strcpy(prevElemId,list->headId);
strcpy(currElemId,listHeadElemId,list->headId); strcpy(currElemId,list->headId);
while(!found){ while(!found){
printf("Recherche dans l'element %s\n",listHeadElemId); printf("Recherche dans l'element %s\n",listHeadElemId);
listElem=msgSpaceListElemOpen(elemId); currElem=msgSpaceListElemOpen(currElemId);
if (listElem==NULL){ if (currElem==NULL){
NZG_ERROR("msgSpaceListElemOpen",elemId); NZG_ERROR("msgSpaceListElemOpen",currElemId);
goto ERROR; goto ERROR;
} }
strcpy(nextElemId,listElem->next); strcpy(nextElemId,currElem->next);
strcpy(currSpaceId,listElem->spaceId); strcpy(currSpaceId,currElem->spaceId);
if (msgSpaceListElemClose(listElem) <0){ if (msgSpaceListElemClose(currElem) <0){
NZG_ERROR("msgSpaceListElemClose",elemId); NZG_ERROR("msgSpaceListElemClose",currElemId);
goto ERROR; goto ERROR;
} }
if (strcmp(prevElemId,nextElemId)==0){ if (strcmp(prevElemId,nextElemId)==0){
// list à 1 seul élement // list à 1 seul élement
if (strcmp(listElem->spaceId,spaceId)==0){ if (strcmp(currElem->spaceId,spaceId)==0){
// on a trouvé l'elem // on a trouvé l'elem
strcpy(list->headId,list->id); strcpy(list->headId,list->id);
strcpy(list->tailId,list->id); strcpy(list->tailId,list->id);
@ -60,7 +63,7 @@ int msgSpaceListRem(msgSpaceId spaceId){
} }
} else { } else {
// liste à plusieurs élements... // liste à plusieurs élements...
if (strcmp(listElem->spaceId,spaceId)==0){ if (strcmp(currElem->spaceId,spaceId)==0){
// ca correspond // ca correspond
// si on est en début de liste (prev=current) // si on est en début de liste (prev=current)
// - la tete de liste pointe sur le suivant // - la tete de liste pointe sur le suivant
@ -78,7 +81,7 @@ int msgSpaceListRem(msgSpaceId spaceId){
//cela ne correspond pas //cela ne correspond pas
//on recopie //on recopie
strcpy(prevElemId,currElemId); strcpy(prevElemId,currElemId);
strcpu(currElemId,nextElemId); strcpy(currElemId,nextElemId);
} }
} }