shared: add nm_streq() and nm_streq0() macro
authorThomas Haller <thaller@redhat.com>
Fri, 12 Feb 2016 11:34:31 +0000 (12:34 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 15 Feb 2016 22:47:14 +0000 (23:47 +0100)
commitdec3a7e58d00bcc8b95a5b02a8c55d2da7a0b2ee
tree25092dd5b0c0d7711906c65bd2d28e3138a16b68
parent6f3d7cbd22a281afc8f374a883a7c3281f890622
shared: add nm_streq() and nm_streq0() macro

Using strcmp() to test for string equality is a well known pattern.
However the inverse logic still is still hard to grasp especially in
more complex expressions.

nm_streq() should is an alternative to use strcmp(). And there is a counterpart
nm_streq0() which is based on g_strcmp0().

Kernel and systemd have also similar streq() macros.

https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00047.html
shared/nm-macros-internal.h