Add file nzg_msgList.c for message list
This commit is contained in:
parent
00e8c700fc
commit
37b871297f
1 changed files with 33 additions and 0 deletions
33
src/nzg_msgList.c
Normal file
33
src/nzg_msgList.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "libnazgul.h"
|
||||
|
||||
/* ajout dans la liste */
|
||||
|
||||
msgSpaceListElem *addBegining( msgSpaceListElem*list,int ownerpid){
|
||||
msgSpaceListElem *unSpacemsgListElem;
|
||||
if( (unSpacemsgListElem=(msgSpaceListElem *)malloc(sizeof(msgSpaceListElem) ) )==NULL){
|
||||
perror("ereur dallocation de memoire");
|
||||
exit(1);}
|
||||
unSpacemsgListElem->ownerPid = ownerpid;
|
||||
return(unSpacemsgListElem);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int test(int argc,char **argv){
|
||||
msgSpaceListElem *ma_liste;
|
||||
msgSpaceListElem *listMove;
|
||||
ma_liste=NULL;
|
||||
ma_liste=addBegining(ma_liste, 3);
|
||||
ma_liste=addBegining(ma_liste, 6);
|
||||
ma_liste=addBegining(ma_liste, 5);
|
||||
for (listMove=ma_liste ;listMove!=NULL ; listMove=listMove->next)
|
||||
{
|
||||
printf("valaeur :%d\n",listMove->ownerpid);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue