summaryrefslogtreecommitdiff
path: root/src/teams.h
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-05-23 18:31:53 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2023-05-23 18:31:53 +0600
commit09133381cad0a1dec37595867eadf9c6858ce8ee (patch)
treea7755e42183c08729e07e2dd2f5ff8054511bd6e /src/teams.h
parent413e443613499a53cc4aa1f35664c289ffbde04b (diff)
downloadc-obp-example-09133381cad0a1dec37595867eadf9c6858ce8ee.tar.gz
c-obp-example-09133381cad0a1dec37595867eadf9c6858ce8ee.zip
Clean up main header file
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/teams.h')
-rw-r--r--src/teams.h27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/teams.h b/src/teams.h
index 74a4159..435ac4a 100644
--- a/src/teams.h
+++ b/src/teams.h
@@ -1,26 +1,15 @@
#ifndef __TEAMS_H__
# define __TEAMS_H__
+# define __TEAMS_PRIVATE_H__
# include <stdint.h>
# include <stdbool.h>
-# define GETTER(klass, field, struct, type, ...) \
- type klass##_get_##field(struct self, ## __VA_ARGS__)
-# define SETTER(klass, field, struct, type, ...) \
- bool klass##_set_##field(struct self, ## __VA_ARGS__, type value)
-# define DEFINE(klass, name, struct, type, ...) \
- type klass##_##name(struct self, ## __VA_ARGS__)
-# define UNUSED(arg) while(0 && (arg))
-# define get(klass, instance, field, ...) \
- klass##_get_##field(instance, ## __VA_ARGS__)
-# define set(klass, instance, field, ...) \
- klass##_set_##field(instance, ## __VA_ARGS__)
-# define new(klass, ...) klass##_new(__VA_ARGS__)
-# define fun(klass, fun, ...) klass##_##fun(__VA_ARGS__)
+# include "teams-hell.h"
// Type definition
typedef struct team_impl_struct * TEAM;
// base functions
-TEAM team_new();
-void team_del(TEAM team);
+NEW(team, TEAM);
+DEL(team, TEAM);
// field getters
SETTER(team, name, TEAM, char *);
@@ -39,10 +28,6 @@ DEFINE(team, printf, TEAM, int);
DEFINE(team, fprintf, TEAM, int, FILE *);
DEFINE(team, find_champion, TEAM, TEAM, TEAM *, unsigned num);
-# ifndef __IMPL_TEAMS_INTERNAL
-# undef GETTER
-# undef SETTER
-# undef DEFINE
-# undef UNUSED
-# endif
+# define __TEAMS_PRIVATE_UNDEF__
+# include "teams-hell.h"
#endif /* __TEAMS_H__ */