OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_util.c versions 1.6 and 1.7
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_util.c 1.6 -> 1.7

--- rc_util.c    2003/05/15 12:49:11     1.6
+++ rc_util.c    2003/05/15 22:22:30     1.7
@@ -105,3 +105,26 @@
 
     return(RC_THROW(RC_OK));
 }
+
+/* Section priority compare, to use with qsort(3) */
+int priCompare(const void *pkv1, const void *pkv2)
+{
+    int nOne = ((rc_section_t *)pkv1)->m_nPri;
+    int nTwo = ((rc_section_t *)pkv2)->m_nPri;
+
+    if (nOne)
+        if (nTwo)
+            if (*(int *)nOne > *(int *)nTwo)
+                return (1);
+            else if (*(int *)nOne < *(int *)nTwo)
+                return (-1);
+            else
+                return (0);
+        else
+            return (-1);
+    else if (nTwo)
+        return (1);
+    else
+        return (0);
+}
+

CVSTrac 2.0.1