From: <enl...@li...> - 2005-07-17 21:15:16
|
Enlightenment CVS committal Author : doursse Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_widget.h ewl_widget.c Log Message: implementation of ewl_widget_data_del =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_widget.h 21 Jun 2005 02:15:51 -0000 1.7 +++ ewl_widget.h 17 Jul 2005 21:15:07 -0000 1.8 @@ -139,7 +139,7 @@ /* * Remove a key value pair from a widget. */ -void ewl_widget_data_del(Ewl_Widget * w, void *k); +void *ewl_widget_data_del(Ewl_Widget * w, void *k); /* * Retrieve a key value pair from a widget. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_widget.c 23 Jun 2005 03:04:47 -0000 1.8 +++ ewl_widget.c 17 Jul 2005 21:15:07 -0000 1.9 @@ -408,21 +408,24 @@ /** * @param w: the widget that owns the key value pair * @param k: the key that is associated with the data - * @return Returns no value. - * @brief Remove the specified key / value pair from the widget + * @return Returns the deleted value. + * @brief Remove the specified key / value pair from the widget and + * return the value. * - * Removes a key / value pair with k as the key from the specified widget w. + * Removes a key / value pair with k as the key from the specified + * widget w and return the value. @c NULL is returned if there is no + * stored data or if an error occurs. */ -void ewl_widget_data_del(Ewl_Widget * w, void *k) +void *ewl_widget_data_del(Ewl_Widget * w, void *k) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); DCHECK_PARAM_PTR("k", k); if (!w->data) - DRETURN(DLEVEL_STABLE); + DRETURN_PTR(NULL, DLEVEL_STABLE); - DLEAVE_FUNCTION(DLEVEL_STABLE); + DRETURN_PTR(ecore_hash_remove(w->data, k), DLEVEL_STABLE); } |