cleanup
[rrq/rrqmisc.git] / pvector / pvector.h
index b41b151f19f5e1616fec110973a216bcc07ef36f..f2236f3898b2c8beef72ea89f92a2f308f5e77ed 100644 (file)
@@ -6,8 +6,6 @@
  * of index pages of 256 pointers.
  */
 
-//#include <stdint.h>
-
 /*!
  * Type: pvector_page
  *
@@ -42,9 +40,7 @@ typedef struct _pvector {
     pvector_page *entries; //!< Pointer to entries indexing
 } pvector;
 
-// Number of page levels for size S
-#define PV_LEVELS(S) ((int)(( 39 - __builtin_clz( ((S)-1) | 1) ) / 8 ))
-
+// Number of slots for page S
 #define PV_LEVEL_SIZE(S) ((int)(exp( 256, (S) )))
 
 // The indexing part for level part p in index i
@@ -126,8 +122,13 @@ void pvector_append(pvector *pv,void *value);
 void pvector_copy(pvector *dst,unsigned long di,
                  pvector *src,unsigned long si,unsigned long n);
 
-void pvector_dump(pvector *pv,int (*itemdump)(unsigned long ,void *));
+void pvector_dump(pvector *pv,
+                 int (*itemdump)(const unsigned long ,const void *));
+
+void pvector_qsort(pvector *pv,int (*compar)(const void *,const void *));
 
-void pvector_qsort(pvector *pv,int (*compar)(void *,void *));
+void pvector_iterate(pvector *pv,
+                    int (*itemfn)(unsigned long,void*,void*),
+                    void*);
 
 #endif