+/*-----------------------------------------------------------------*/
+/* indexSet - returns the i'th item in set */
+/*-----------------------------------------------------------------*/
+void *
+indexSet (set * s, int index)
+{
+ set *loop=s;
+
+ while(loop && index) {
+ index--;
+ loop = loop->next;
+ }
+
+ return (loop->item);
+}
+
+
+/*-----------------------------------------------------------------*/
+/* reverseSet - reverse the order of the items of a set */
+/*-----------------------------------------------------------------*/
+
+set *
+reverseSet (set * s)
+{
+ set *t = NULL;
+ set *u = NULL;
+
+ while(s->next) {
+ t = s->next;
+ s->next = u;
+ u = s;
+ s = t;
+ }
+ s->next = u;
+ return s;
+}
+