[Xfce4-commits] <xfce4-panel:devel> Add macros for common list counting without traversing the list.

Nick Schermer nick at xfce.org
Tue Aug 11 20:28:36 CEST 2009


Updating branch refs/heads/devel
         to eab2c2dd87ef1f7696a0aecfc8da9d9d1d4eabae (commit)
       from b2930e53ff27a04a64bd38b5d47d41ca7b8c48cb (commit)

commit eab2c2dd87ef1f7696a0aecfc8da9d9d1d4eabae
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Mar 5 22:20:11 2009 +0100

    Add macros for common list counting without traversing the list.

 common/panel-private.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/common/panel-private.h b/common/panel-private.h
index 6576176..4df473b 100644
--- a/common/panel-private.h
+++ b/common/panel-private.h
@@ -37,4 +37,8 @@
 /* xfconf property base (printf format) */
 #define PANEL_PLUGIN_PROPERTY_BASE "/plugins/plugin-%d"
 
+/* quick GList and GSList counting without traversing */
+#define LIST_HAS_ONE_ENTRY(l)           ((l) != NULL && (l)->next == NULL)
+#define LIST_HAS_TWO_OR_MORE_ENTRIES(l) ((l) != NULL && (l)->next != NULL)
+
 #endif /* !__PANEL_PRIVATE_H__ */
\ No newline at end of file



More information about the Xfce4-commits mailing list