54 lines
No EOL
1.2 KiB
C
54 lines
No EOL
1.2 KiB
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "conf.h"
|
|
|
|
ptConf newConfChain() {
|
|
ptConf confChain = (ptConf) malloc(sizeof(ptConf));
|
|
|
|
confChain -> next = NULL;
|
|
|
|
return confChain;
|
|
}
|
|
|
|
void addConf(ptConf confChainStart, char title[], char speaker[], int day, int month, int year) {
|
|
ptConf px = confChainStart;
|
|
|
|
while (px -> next != NULL) {
|
|
px = px -> next;
|
|
}
|
|
|
|
px -> day = day;
|
|
px -> month = month;
|
|
px -> year = year;
|
|
strcpy(px -> title, title);
|
|
strcpy(px -> speaker, speaker);
|
|
// ajouter le builder de liste de participants
|
|
px -> next = (ptConf) malloc(sizeof(ptConf));
|
|
px -> next -> next = NULL;
|
|
}
|
|
|
|
ptListener newListenerChain() {
|
|
ptListener listenerChain = (ptListener) malloc(sizeof(ptListener));
|
|
|
|
listenerChain -> prev = NULL;
|
|
listenerChain -> next = NULL;
|
|
|
|
return listenerChain;
|
|
}
|
|
|
|
void addListener(ptListener listenerChain, char name[], int age, int level) {
|
|
ptListener px = listenerChain;
|
|
|
|
while (px -> next != NULL) {
|
|
px = px -> next;
|
|
}
|
|
|
|
strcpy(px -> name, name);
|
|
px -> age = age;
|
|
px -> level = level;
|
|
// ajouter la liste de conférences
|
|
px -> next = (ptListener) malloc(sizeof(ptListener));
|
|
px -> next -> next = NULL;
|
|
px -> next -> prev = px;
|
|
} |