+int str_nr_last_in_list( struct idlist **idl, const char *str)
+/* return the last position of str in idl */
+{
+ int nr, ret = -1;
+ struct idlist *walk;
+ if ( !str )
+ return -1;
+ for( walk = *idl, nr = 0; walk; nr ++, walk = walk->next )
+ if( strcmp( str, walk->id) == 0 )
+ ret = nr;
+ return ret;
+}
+
+void str_set_mark( struct idlist **idl, const char *str, const flag val)
+/* update the mark on an of an id to given value */
+{
+ int nr;
+ struct idlist *walk;
+ if (!str)
+ return;
+ for(walk = *idl, nr = 0; walk; nr ++, walk = walk->next)
+ if (strcmp(str, walk->id) == 0)
+ walk->val.status.mark = val;
+}
+
+int count_list( struct idlist **idl)
+/* count the number of elements in the list */
+{
+ if( !*idl )
+ return 0;
+ return 1 + count_list( &(*idl)->next );
+}
+
+char *str_from_nr_list(struct idlist **idl, int number)
+/* return the number'th string in idl */
+{
+ if( !*idl || number < 0)
+ return 0;
+ if( number == 0 )
+ return (*idl)->id;
+ return str_from_nr_list(&(*idl)->next, number-1);
+}
+
+
+char *str_find(struct idlist **idl, int number)
+/* return the id of the given number in the given list. */
+{
+ if (*idl == (struct idlist *) 0)
+ return((char *) 0);
+ else if (number == (*idl)->val.status.num)
+ return((*idl)->id);
+ else
+ return(str_find(&(*idl)->next, number));
+}
+
+char *idpair_find(struct idlist **idl, const char *id)
+/* return the id of the given id in the given list (caseblind comparison) */
+{
+ if (*idl == (struct idlist *) 0)
+ return((char *) 0);
+ else if (strcasecmp(id, (*idl)->id) == 0)
+ return((*idl)->val.id2 ? (*idl)->val.id2 : (*idl)->id);