66 lines
1.7 KiB
C
66 lines
1.7 KiB
C
#ifndef CONF_H
|
|
#define CONF_H
|
|
|
|
struct listenerList;
|
|
|
|
typedef struct conf
|
|
{
|
|
int id;
|
|
char title[30];
|
|
char speaker[20];
|
|
int day;
|
|
int month;
|
|
int year;
|
|
struct listenerList *listeners;
|
|
struct conf *next;
|
|
} tConf;
|
|
|
|
typedef struct confList
|
|
{
|
|
struct conf *conf;
|
|
int grade;
|
|
struct confList *next;
|
|
} tConfList;
|
|
|
|
typedef struct listener
|
|
{
|
|
int id;
|
|
char name[20];
|
|
int age;
|
|
int level;
|
|
struct confList *confs;
|
|
struct listener *prev;
|
|
struct listener *next;
|
|
} tListener;
|
|
|
|
typedef struct listenerList
|
|
{
|
|
struct listener *listener;
|
|
int grade;
|
|
struct listenerList *next;
|
|
} tListenerList;
|
|
|
|
typedef tConf *ptConf;
|
|
typedef tListener *ptListener;
|
|
typedef tConfList *ptConfList;
|
|
typedef tListenerList *ptListenerList;
|
|
|
|
int findConfId(ptConf confChain);
|
|
ptConf newConfChain();
|
|
void addConf(ptConf confChain, int id, char title[], char speaker[], int day, int month, int year);
|
|
void removeConf(ptConf confChain, int id);
|
|
int findListenerId(ptListener listenerChain);
|
|
ptListener newListenerChain();
|
|
int addListener(ptListener listenerChain, int id, char name[], int age, int level);
|
|
void removeListener(ptListener listenerChain, int id);
|
|
void addConfToConfList(ptConfList confList, ptConf conf, int grade);
|
|
void removeConfFromConfList(ptConfList confList, ptConf conf);
|
|
void printConfList(ptConfList confList);
|
|
void addListenerToListenerList(ptListenerList listenerList, ptListener listener, int grade);
|
|
void removeListenerFromListenerList(ptListenerList listenerList, ptListener listener);
|
|
void printListenerList(ptListenerList listenerList);
|
|
int participateToConf(ptConf confChain, ptListener listenerChain, int confId, int listenerId, int grade);
|
|
int confGradeAvg(ptConf conf);
|
|
int confParticipations(ptConf conf);
|
|
|
|
#endif // CONF_H
|