#ifndef __PERSON_H__ #define __PERSON_H__ typedef void *(*Vtable_entry)(); #define PERSON_DELETE 0 #define PERSON_TOSTRING 1 #define PERSON_GET_NAME 2 typedef struct person_s { Vtable_entry* vtable; char *name; } Person; // Allocates and initializes a new Person // // Returns: // -- A Person, if successful // -- A NULL pointer in the event of a memory allocation error. Person *person_new(const char *name); Person *person_init(Person *p, const char* name); // Deletes a person. // // Returns: // -- zero on success. // -- -1 in the event of an error. int person_delete(Person *p); int person_clean(Person *p); // Other class methods char *person_toString(const Person *); const char *person_get_name(const Person *); #endif // __PERSON_H__