/*- * Copyright (c) 2012 valsorym . * All rights reserved. * * Discussion on the forums.freebsd.org. * url: http://forums.freebsd.org/showthread.php?p=177208 */ /* * Very simple class, for example OOD in ANSI C. */ /* NEW TYPES */ /* ************************************************************************* */ #ifndef HUMAN_H #define HUMAN_H #include #include #include /* Сlass of persons. */ struct w_human { /* Private: */ int age; char *name; /* Public: */ int (*setage)(struct w_human *, int ); int (*getage)(struct w_human *); char *(*setname)(struct w_human *, char *); char *(*getname)(struct w_human *); }; /* Class initializer. */ extern const struct w_human_initializer { struct w_human *(*create)(int , char *); void (*destroy)(struct w_human *); } w_human; #endif /* The End. */