From c71dcffdf6bb1fc317f84cb330ed1269edee7282 Mon Sep 17 00:00:00 2001 From: Lukian Date: Sun, 12 Nov 2023 14:59:55 +0100 Subject: [PATCH] commit --- conf.c | 25 ++++++++++++++++++++++++- conf.h | 31 ++++++++++++++++++++++++++++--- main | Bin 16104 -> 16216 bytes main.c | 7 +++++-- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/conf.c b/conf.c index 4c2891c..4652498 100644 --- a/conf.c +++ b/conf.c @@ -14,5 +14,28 @@ ptDate newDate(int day, int month, int year) { } void printDate(ptDate date) { - printf("%d/%d/%d\n", date -> day, date -> month, date -> year); + printf("date : %d/%d/%d\n", date -> day, date -> month, date -> year); +} + +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 -> date = newDate(day, month, 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; } \ No newline at end of file diff --git a/conf.h b/conf.h index ef572af..b7d0b8e 100644 --- a/conf.h +++ b/conf.h @@ -7,18 +7,43 @@ typedef struct date { int year; } tDate; +struct listenerList; + typedef struct conf { - tDate date; + tDate *date; char title[30]; char speaker[20]; - struct tConf* next; + struct listenerList* listeners; + struct conf* next; } tConf; +typedef struct confList { + struct tConf* conf; + struct tConfList* next; +} tConfList; + +typedef struct listener { + char name[20]; + int age; + int level; + struct tConfList* confs; + struct tListener* next; +} tListener; + +typedef struct listenerList { + struct tListener* listener; + struct tListenerList* next; +} tListenerList; + typedef tDate* ptDate; typedef tConf* ptConf; +typedef tListener* ptListener; +typedef tConfList* ptConfList; +typedef tListenerList* ptListenerList; ptDate newDate(int day, int month, int year); - void printDate(ptDate date); +ptConf newConfChain(); +void addConf(ptConf confChainStart, char title[], char speaker[], int day, int month, int year); #endif // CONF_H \ No newline at end of file diff --git a/main b/main index 81ad83d0e7db242ec9a69ea6ae1b69d2966ef6d6..47276e7e8b8ffd8d889e499b34cb20eb254ab322 100644 GIT binary patch delta 2414 zcmZ`*YfKbZ6uvY2V3&vN>`K;E>Mp(zDm%N2lrHSbZei^}imt5~(lk*bs6f{gFj5PKPon+(Vz)7CdFDGq^8)!L`?calQu4qM5VO>V>>-}<_6IA$Yii)cUw2Z~Nu2hEx_IB;9c>@;XbrvdDoH+q57OdSae zKxz8eP>JRr3crXuc+E~g59bs{m}-QnM&KkjUJ&wVnwN2-Mw5+jgkN9qecLiznr%X4N6>3tO!OeNo1p z9rzNf#glrpY17L^v!ktB(C{=Xkj_UKZ;5DrjfZbdYh5OdQST3{G=r{42IQEXIeGxf zkAfeWYfO`Yj1j_SCubgRGPhX|+m={96$zPEmZzZDR$QYl-Sp%|MN#_y$X)yd9ewD} zb=MHW?AS|o_$9jxI&4LC4rKq_=FN2N5o>1ZR?YQp)s~7yAcClUC(U zuDhG+E-^&CRn?dAaNm~CT?UJ=xaczKN&Bk}Qg8Sx+Lh$rli5-#{52Zs*?$xz-HeG} zF&%~V!iw!9G+_FHs*BA?sn|^P{5`Bdbfg2h^Lf!_lhLnN=Ili&*nS9=pv-GY^&64 ze^51YTvCya$`Z#Jsv85RXBl2)|0Mgc$Jmu@X=_UoyyLAkxvRxf;aT36*_LQ&+S#&4 zGe~n&QstY)<@7(3R)Je&sEi}x>qCBfpeS_jEPJRZrw~^o{)pI&xC^oVk)r&HIF9%f zF>hK?^6_PVds@j-LfF}d#CsfU@+^7fA;wyP8d8&?zNE{ryBe=X#wjdB|GDS={3#R+`|ZkSuVy7 z!EA|}I}I+ci1%8rn>z}vUQrlg2Ln4#i3BITZXr(35^VIipsgQnd)ISYph$Fc>!4QL z&W*qsv5&-1dns{j_6F@)7fPLxJDP4MEVq z8Amzd7hU>?Lswo`I}Q?pyQ*^5U&ZZ&U|LIHXYqF3NuL_d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git a/main.c b/main.c index 90697d9..62255dd 100644 --- a/main.c +++ b/main.c @@ -4,9 +4,12 @@ int main() { - ptDate date = newDate(12,12,2023); + ptConf confChain = newConfChain(); - printDate(date); + addConf(confChain, "test", "tesst", 21, 120, 2023); + + printf("title : %s\nspeaker : %s\n", confChain -> title, confChain -> speaker); + printDate(confChain -> date); return 0; } \ No newline at end of file