|
From: <sv...@va...> - 2005-07-03 20:22:24
|
Author: njn
Date: 2005-07-03 21:22:07 +0100 (Sun, 03 Jul 2005)
New Revision: 4102
Log:
Comment changes only.
Modified:
trunk/include/pub_tool_skiplist.h
Modified: trunk/include/pub_tool_skiplist.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_skiplist.h 2005-07-03 18:45:37 UTC (rev 4101)
+++ trunk/include/pub_tool_skiplist.h 2005-07-03 20:22:07 UTC (rev 4102)
@@ -53,11 +53,13 @@
SkipNode *head; // list head
};
=20
-/* Use this macro to initialize your skiplist head. The arguments are p=
retty self explanitory:
+/* Use this macro to initialize your skiplist head:
_type is the type of your element structure
_key is the field within that type which you want to use as the key
- _cmp is the comparison function for keys - it gets two typeof(_key) p=
ointers as args
- _strkey is a function which can return a string of your key - it's on=
ly used for debugging
+ _cmp is the comparison function for keys - it gets two typeof(_key)=20
+ pointers as args
+ _strkey is a function which can return a string of your key - it's on=
ly
+ used for debugging
_arena is the arena to use for allocation - -1 is the default
*/
#define VG_SKIPLIST_INIT(_type, _key, _cmp, _strkey, _arena) \
@@ -76,7 +78,7 @@
Exact: returns a node which is =3D=3D key, or NULL if none
After: returns a node which is >=3D key, or NULL if none
SkipList_Insert inserts a new element into the list. Duplicates are
- forbidden. The element must have been created with SkipList_Alloc=
!
+ forbidden. The element must have been created with SkipNode_Alloc=
!
SkipList_Remove removes an element from the list and returns it. It
doesn't free the memory.
*/
@@ -103,9 +105,9 @@
=20
You can iterate through a SkipList like this:
=20
- for(x =3D VG_(SkipNode_First)(&list); // or SkipList_Find
- x !=3D NULL;
- x =3D VG_(SkipNode_Next)(&list, x)) { ... }
+ for (x =3D VG_(SkipNode_First)(&list);
+ x !=3D NULL;
+ x =3D VG_(SkipNode_Next)(&list, x)) { ... }
*/
extern void *VG_(SkipNode_Alloc) (const SkipList *l);
extern void VG_(SkipNode_Free) (const SkipList *l, void *p);
|