Enlightenment CVS committal

Author  : mej
Project : eterm
Module  : libast

Dir     : eterm/libast/include/libast


Modified Files:
        types.h.in 


Log Message:
Tue Jun 29 14:32:01 2004                        Michael Jennings (mej)

I'll document all this stuff shortly.
----------------------------------------------------------------------

===================================================================
RCS file: /cvsroot/enlightenment/eterm/libast/include/libast/types.h.in,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- types.h.in  3 Feb 2004 23:16:59 -0000       1.17
+++ types.h.in  29 Jun 2004 18:32:20 -0000      1.18
@@ -841,6 +841,29 @@
  */
 #define SPIF_CMP_IS_GREATER(cmp)  ((cmp) == SPIF_CMP_GREATER)
 
+/**
+ * Convenience macro for comparing possibly NULL values.
+ *
+ * This macro exists because I got tired of typing the same thing over
+ * and over again to handle comparisons of two pointers, either of
+ * which may be NULL.
+ *
+ * @param p1  The first pointer.
+ * @param p2  The second pointer.
+ * @return    
+ *
+ * @see @link DOXGRP_STRINGS String Utility Routines @endlink, SPIF_PTR_ISNULL()
+ */
+#define SPIF_COMP_CHECK_NULL(p1, p2) do { \
+                                         if (SPIF_PTR_ISNULL((p1)) && 
SPIF_PTR_ISNULL((p2))) { \
+                                             return SPIF_CMP_EQUAL; \
+                                         } else if (SPIF_PTR_ISNULL((p1))) { \
+                                             return SPIF_CMP_LESS; \
+                                         } else if (SPIF_PTR_ISNULL((p2))) { \
+                                             return SPIF_CMP_GREATER; \
+                                         } \
+                                     } while (0)
+
 #undef false
 #undef False
 #undef FALSE




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to