*** empty log message ***

This commit is contained in:
glenux 2004-02-26 07:36:00 +00:00 committed by Glenn Y. Rolland
parent 6f29735ceb
commit d667830211
2 changed files with 32 additions and 20 deletions

View file

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

View file

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