summaryrefslogtreecommitdiffstats
path: root/src/sbus/sssd_dbus.h
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2016-06-27 11:56:52 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-06-27 16:34:58 +0200
commitd6f1b16baf8106d709e3fac585a12789dcb6bd29 (patch)
tree28801fa7204da45112d57f60f524adc9b95ded4e /src/sbus/sssd_dbus.h
parent725c291ccfa46b08d2713133c227ac8d7203eb2f (diff)
downloadsssd-d6f1b16baf8106d709e3fac585a12789dcb6bd29.tar.gz
sssd-d6f1b16baf8106d709e3fac585a12789dcb6bd29.tar.xz
sssd-d6f1b16baf8106d709e3fac585a12789dcb6bd29.zip
SBUS: Add string helper macros
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/sbus/sssd_dbus.h')
-rw-r--r--src/sbus/sssd_dbus.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sbus/sssd_dbus.h b/src/sbus/sssd_dbus.h
index 170b16bf9..fe1c4a7e1 100644
--- a/src/sbus/sssd_dbus.h
+++ b/src/sbus/sssd_dbus.h
@@ -61,6 +61,12 @@ struct sbus_request;
*/
#define SBUS_SUBTREE_SUFFIX "/*"
+/**
+ * It is not possible to send NULL over D-Bus. We can only test if it
+ * is empty or not.
+ */
+#define SBUS_IS_STRING_EMPTY(str) ((str) == NULL || (str)[0] == '\0')
+#define SBUS_SET_STRING(str) (SBUS_IS_STRING_EMPTY(str) ? NULL : (str))
typedef int (*sbus_msg_handler_fn)(struct sbus_request *dbus_req,