From 3ad3455551be0d7859ecb02290376206d5e66498 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Apr 2012 09:20:32 +1000 Subject: And actually include new files, plus elementary libraries. --- .../eina/src/examples/eina_model_04_whistler.c | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 libraries/eina/src/examples/eina_model_04_whistler.c (limited to 'libraries/eina/src/examples/eina_model_04_whistler.c') diff --git a/libraries/eina/src/examples/eina_model_04_whistler.c b/libraries/eina/src/examples/eina_model_04_whistler.c new file mode 100644 index 0000000..ed9832f --- /dev/null +++ b/libraries/eina/src/examples/eina_model_04_whistler.c @@ -0,0 +1,59 @@ +/* + * whistler.c + * + */ + +#include "eina_model_04_whistler.h" + +void +whistler_whistle(Eina_Model *m) +{ + const Eina_Model_Interface *iface = NULL; + iface = eina_model_interface_get(m, WHISTLER_INTERFACE_NAME); + + EINA_SAFETY_ON_NULL_RETURN(iface); + + void (*pf)(Eina_Model *); + + pf = eina_model_interface_method_resolve(iface, m, Whistler_Interface, whistle); + EINA_SAFETY_ON_NULL_RETURN(pf); + printf("%s() \t", __func__); + pf(m); +} +/* + * call for overridden Swimmer Interface function + */ +void +swimmer_swim(Eina_Model *m) +{ + const Eina_Model_Interface *iface = NULL; + iface = eina_model_interface_get(m, SWIMMER_INTERFACE_NAME); + + EINA_SAFETY_ON_NULL_RETURN(iface); + + void (*pf)(Eina_Model *); + + pf = eina_model_interface_method_resolve(iface, m, Swimmer_Interface, swim); + EINA_SAFETY_ON_NULL_RETURN(pf); + printf("%s() \t", __func__); + pf(m); +} + +/* + * call for overridden Diver Interface function + */ +void +diver_dive(Eina_Model *m) +{ + const Eina_Model_Interface *iface = NULL; + iface = eina_model_interface_get(m, DIVER_INTERFACE_NAME); + + EINA_SAFETY_ON_NULL_RETURN(iface); + + void (*pf)(Eina_Model *); + + pf = eina_model_interface_method_resolve(iface, m, Diver_Interface, dive); + EINA_SAFETY_ON_NULL_RETURN(pf); + printf("%s() \t", __func__); + pf(m); +} -- cgit v1.1