diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-28 15:31:41 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-28 15:31:41 +0000 |
| commit | b3b2e6f22d8e7f963bb1b86ebacf387f762d97a8 (patch) | |
| tree | 8b711c18cc0b2c5a5442b4481c1e95a05497aa80 | |
| parent | 016ee53393426a3e9fceacf3c023643ca39ca425 (diff) | |
| download | lasso-b3b2e6f22d8e7f963bb1b86ebacf387f762d97a8.tar.gz lasso-b3b2e6f22d8e7f963bb1b86ebacf387f762d97a8.tar.xz lasso-b3b2e6f22d8e7f963bb1b86ebacf387f762d97a8.zip | |
Core: add new macros to lasso/utils.h, fix lasso_assign_new_list_of_gobjects
* lasso/utils.h:
add:
- lasso_assign_new_xml_node
- lasso_assign_new_list_of_strings
- lasso_assign_new_list_of_xml_node
fix lasso_assign_new_list_of_gobjects, bad naming of release macro.
| -rw-r--r-- | lasso/utils.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lasso/utils.h b/lasso/utils.h index 94ff4884..122167c8 100644 --- a/lasso/utils.h +++ b/lasso/utils.h @@ -195,10 +195,33 @@ dest = xmlCopyNode(__tmp, 1); \ } +#define lasso_assign_new_xml_node(dest,src) \ + { \ + xmlNode *__tmp = (src); \ + lasso_check_type_equality(dest, src); \ + if (dest) \ + xmlFreeNode(dest); \ + dest = __tmp; \ + } + #define lasso_assign_new_list_of_gobjects(dest, src) \ { \ GList *__tmp = (src); \ - lasso_release_gobject_list(dest); \ + lasso_release_list_of_gobjects(dest); \ + dest = (GList*)__tmp; \ + } + +#define lasso_assign_new_list_of_strings(dest, src) \ + { \ + GList *__tmp = (src); \ + lasso_release_list_of_strings(dest); \ + dest = (GList*)__tmp; \ + } + +#define lasso_assign_new_list_of_xml_node(dest, src) \ + { \ + GList *__tmp = (src); \ + lasso_release_list_of_xml_node(dest); \ dest = (GList*)__tmp; \ } |
