summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-message.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-02-19 03:53:24 +0000
committerHavoc Pennington <hp@redhat.com>2003-02-19 03:53:24 +0000
commitc21511c01ab56d75f3aa4643761e9fd096a7f8be (patch)
tree7a0542dd8d02b8fd8e98e42409b1bf42564d32c0 /dbus/dbus-message.c
parent78e16e99e753175fa49e787eab256932eefaa03f (diff)
2003-02-19 Havoc Pennington <hp@pobox.com>
Throughout: mop up all the Doxygen warnings and undocumented stuff. * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want to search any paths. * dbus/dbus-threads.c: move global mutex initializers to dbus-internals.h, multiple prototypes was confusing doxygen besides being kind of ugly * Doxyfile (PREDEFINED): have Doxygen define DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS (do not abuse the feature! it's for stuff like the autogenerated macros in dbus-md5.c, not just for things you don't feel like documenting...)
Diffstat (limited to 'dbus/dbus-message.c')
-rw-r--r--dbus/dbus-message.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index e6c51784..203f0a6c 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -1001,7 +1001,7 @@ dbus_message_get_service (DBusMessage *message)
* with 0.
*
* @param message the message
- * @param first_argument_type type of the first argument
+ * @param first_arg_type type of the first argument
* @param ... value of first argument, list of additional type-value pairs
* @returns #TRUE on success
*/
@@ -1735,12 +1735,27 @@ dbus_message_get_sender (DBusMessage *message)
return get_string_field (message, FIELD_SENDER, NULL);
}
+/**
+ * Checks whether the message has the given name.
+ * If the message has no name or has a different
+ * name, returns #FALSE.
+ *
+ * @param message the message
+ * @param name the name to check (must not be #NULL)
+ *
+ * @returns #TRUE if the message has the given name
+ */
dbus_bool_t
dbus_message_name_is (DBusMessage *message,
const char *name)
{
- if (dbus_message_get_name (message) &&
- strcmp (dbus_message_get_name (message), name) == 0)
+ const char *n;
+
+ _dbus_assert (name != NULL);
+
+ n = dbus_message_get_name (message);
+
+ if (n && strcmp (n, name) == 0)
return TRUE;
else
return FALSE;