summaryrefslogtreecommitdiff
path: root/src/teams.h
blob: 435ac4ad5d33479b34adf5f95fed4c7c13a5ecc5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __TEAMS_H__
#	define __TEAMS_H__
#	define __TEAMS_PRIVATE_H__
#	include <stdint.h>
#	include <stdbool.h>
#	include "teams-hell.h"
// Type definition
typedef struct team_impl_struct * TEAM;

// base functions
NEW(team, TEAM);
DEL(team, TEAM);

// field getters
SETTER(team, name,			TEAM, char *);
SETTER(team, institution,	TEAM, char *);
SETTER(team, member_name,	TEAM, char *, int);
SETTER(team, solved,		TEAM, uint8_t);

// field setters
GETTER(team, name,			TEAM, char *);
GETTER(team, institution,	TEAM, char *);
GETTER(team, member_name,	TEAM, char *, int);
GETTER(team, solved,		TEAM, uint8_t);

// helper functions
DEFINE(team, printf,  		TEAM,  int);
DEFINE(team, fprintf, 		TEAM,  int, FILE *);
DEFINE(team, find_champion, TEAM, TEAM, TEAM *, unsigned num);

#	define __TEAMS_PRIVATE_UNDEF__
#	include "teams-hell.h"
#endif /* __TEAMS_H__ */