diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-11-04 01:58:42 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-11-04 01:58:42 +0000 |
| commit | a62a31e5bcb73b22249291bf53df578f7207b611 (patch) | |
| tree | 67e2d3f553a52abb4acf3e2bfb5af3004025dd6f | |
| parent | 4e28ae10255bf8d33b20e321d541ba56f0a43594 (diff) | |
Add new utils macros
- lasso/utils.h:
- add goto_exit_with_rc a standardized macro that suppose having an
'int rc' variable and an exit label in the current function.
- add lasso_release_output_buffer macro
| -rw-r--r-- | lasso/utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lasso/utils.h b/lasso/utils.h index f6aac50b..d1302ea6 100644 --- a/lasso/utils.h +++ b/lasso/utils.h @@ -137,6 +137,9 @@ #define lasso_release_key_manager(dest) \ lasso_release_full(dest, xmlSecKeysMngrDestroy) +#define lasso_release_output_buffer(dest) \ + lasso_release_full(dest, xmlOutputBufferClose) + /* Bad param handling */ #define lasso_return_val_if_invalid_param(kind, name, val) \ g_return_val_if_fail(LASSO_IS_##kind(name), val) @@ -148,6 +151,12 @@ #define lasso_null_param(name) \ g_return_val_if_fail(name != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); +#define goto_exit_with_rc(rc_value) \ + {\ + rc = (rc_value); \ + goto exit; \ + } + #define goto_exit_if_fail(condition, rc_value) \ {\ if (! (condition) ) {\ |
