From d98f46ce647846b0aa30b2e16a30fd4e152a1bf5 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:55:07 +0200 Subject: Add new code Signed-off-by: Carlos Maiolino --- C/OOP/include/animal_p.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 C/OOP/include/animal_p.h (limited to 'C/OOP/include/animal_p.h') diff --git a/C/OOP/include/animal_p.h b/C/OOP/include/animal_p.h new file mode 100644 index 0000000..e09aa7c --- /dev/null +++ b/C/OOP/include/animal_p.h @@ -0,0 +1,23 @@ +/* Animal class public interface */ + +#ifndef ANIMAL_P_H +#define ANIMAL_P_H + +/* Forward declaration */ +struct animal; + +/* Alloc new object */ +struct animal* animal_new(void); + +/* Constructor - make_sound may be NULL*/ +void animal_ctor(struct animal*, void (*make_sound)(void)); + +/* Destructor */ +void animal_dtor(struct animal*); + +/* Behavior */ +void animal_get_name(struct animal*, char*); +void animal_set_name(struct animal*, const char*); +void animal_sound(void *); + +#endif /* ANIMAL_P_H */ -- cgit v1.2.3