diff options
Diffstat (limited to 'src/teams.h')
-rw-r--r-- | src/teams.h | 27 |
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__ */ |