diff options
author | 2025-05-19 14:08:11 +0600 | |
---|---|---|
committer | 2025-05-19 14:08:11 +0600 | |
commit | ff1ba1e770b4205c2cc367ff513325e5f22c73e8 (patch) | |
tree | 8bef720b23626dc8945d6da9897020766ec61274 /src/teams.h | |
parent | 815eca3e8f367a6fed50be59b10316b5028773aa (diff) | |
download | c-obp-example-ff1ba1e770b4205c2cc367ff513325e5f22c73e8.tar.gz c-obp-example-ff1ba1e770b4205c2cc367ff513325e5f22c73e8.zip |
Code cleanup and reuse
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | src/teams.h | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/teams.h b/src/teams.h index 15aad82..c65bad3 100644 --- a/src/teams.h +++ b/src/teams.h @@ -6,29 +6,15 @@ # include "common.h" // Type definition -CLASS(team); - -// base functions -NEW(team); -DEL(team); - -// field getters -SETTER(team, name, ref(char)); -SETTER(team, institution, ref(char)); -SETTER(team, member_name, ref(char), int); -SETTER(team, solved, uint8_t); - -// field setters -GETTER(team, name, ptr(char)); -GETTER(team, institution, ptr(char)); -GETTER(team, member_name, ptr(char), int); -GETTER(team, solved, uint8_t); - -// helper functions -DEFINE(team, printf, int); -DEFINE(team, fprintf, int, ptr(FILE)); -DEFINE(team, find_champion, team, ptr(team), unsigned); - +CLASS( team, { + LIST(team, name, char, [255]); + LIST(team, member_name, char, [3][255], int); + LIST(team, institution, char, [255]); + ATOM(team, solved, uint8_t); + FUNC(team, printf, int); + FUNC(team, fprintf, int, FILE *); + FUNC(team, find_champion, team, ptr(team), size_t); +}); # include "cobj.h" #endif /* __TEAMS_H__ */ /* vim: ts=8 */ |