From b968a481ae558c26082e10d651a0f799a8033824 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Mon, 3 Apr 2006 10:08:46 +0000 Subject: Reformat and document str_nr_in_list() better. svn path=/branches/BRANCH_6-3/; revision=4775 --- uid.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/uid.c b/uid.c index 6516c329..cfb47b8a 100644 --- a/uid.c +++ b/uid.c @@ -1,5 +1,5 @@ -/* - * uid.c -- UIDL handling for POP3 servers without LAST +/** + * \file uid.c -- UIDL handling for POP3 servers without LAST * * For license terms, see the file COPYING in this directory. */ @@ -359,15 +359,16 @@ struct idlist *str_in_list(struct idlist **idl, const char *str, const flag case return NULL; } -int str_nr_in_list( struct idlist **idl, const char *str ) - /* return the position of str in idl */ +/** return the position of first occurrence of \a str in \a idl */ +int str_nr_in_list(struct idlist **idl, const char *str) { int nr; struct idlist *walk; - if ( !str ) + + if (!str) return -1; - for( walk = *idl, nr = 0; walk; nr ++, walk = walk->next ) - if( strcmp( str, walk->id) == 0 ) + for (walk = *idl, nr = 0; walk; nr ++, walk = walk->next) + if (strcmp(str, walk->id) == 0) return nr; return -1; } -- cgit v1.2.3