summaryrefslogtreecommitdiff
path: root/libgsystem.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-07-05 11:48:09 -0400
committerColin Walters <walters@verbum.org>2013-07-05 11:48:09 -0400
commite270f5379bd794391e9a8f1be7f9aa17f0d7dd97 (patch)
tree916024aa14d54362d8a90256332dcf28b1d7281c /libgsystem.h
parent8e11654015d91b62049315aa7f9a459d0ec2c82e (diff)
downloadlibgsystem-e270f5379bd794391e9a8f1be7f9aa17f0d7dd97.tar.gz
Add gs_transfer_out_value() macro
A simple macro to help with out parameters.
Diffstat (limited to 'libgsystem.h')
-rw-r--r--libgsystem.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libgsystem.h b/libgsystem.h
index c7aea6c..60884b6 100644
--- a/libgsystem.h
+++ b/libgsystem.h
@@ -25,6 +25,14 @@
G_BEGIN_DECLS
+#define gs_transfer_out_value(outp, srcp) G_STMT_START { \
+ if (outp) \
+ { \
+ *(outp) = *(srcp); \
+ *(srcp) = NULL; \
+ } \
+ } G_STMT_END;
+
#include <gsystem-console.h>
#include <gsystem-file-utils.h>
#include <gsystem-shutil.h>