Index: /libmpc/trunk/mpcchap/iniparser.c
===================================================================
--- /libmpc/trunk/mpcchap/iniparser.c	(revision 392)
+++ /libmpc/trunk/mpcchap/iniparser.c	(revision 393)
@@ -83,7 +83,7 @@
     static char l[ASCIILINESZ+1];
 	char * last ;
-	
+
     if (s==NULL) return NULL ;
-    
+
 	while (isspace((int)*s) && *s) s++;
 	memset(l, 0, ASCIILINESZ+1);
@@ -170,5 +170,18 @@
 }
 
-int iniparser_getnkey(dictionary * d, int nsec)
+/*-------------------------------------------------------------------------*/
+/**
+  @brief    Get number of keys for section n in a dictionary.
+  @param    d   Dictionary to examine
+  @param    n   Section number (from 0 to nsec-1).
+  @return   Number of keys in section
+
+  This function locates the n-th section in a dictionary and returns
+  the number of keys in this section.
+
+  This function returns -1 in case of error.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getnkey(dictionary * d, int n)
 {
 	int i, i_sec, cnt = 0 ;
@@ -179,9 +192,9 @@
 			continue ;
 		if (strchr(d->key[i], ':')==NULL) {
-			if (nsec == -1)
+			if (n == -1)
 				break;
-			nsec -- ;
+			n -- ;
 		}
-		if (nsec == -1)
+		if (n == -1)
 			cnt ++;
 	}
@@ -189,4 +202,21 @@
 }
 
+/*-------------------------------------------------------------------------*/
+/**
+  @brief    Get key and string for key nkey in section nsec in a dictionary.
+  @param    d   Dictionary to examine
+  @param    nsec   Section number.
+  @param    nkey   Key number.
+  @param    string   Pointer where the string will be returned.
+  @return   Pointer to char string
+
+  This function locates the nkey-th key in the nsec-th section in a dictionary
+  and returns the key name and the key string as a pointer to strings
+  statically allocated inside the dictionary.
+  Do not free or modify the returned strings!
+
+  This function returns NULL in case of error.
+ */
+/*--------------------------------------------------------------------------*/
 char * iniparser_getkeyname(dictionary * d, int nsec, int nkey, char ** string)
 {
@@ -212,5 +242,5 @@
 		nkey--;
 	}
-	
+
 	*string = d->val[i];
 	return d->key[i] + keylen;
@@ -505,5 +535,5 @@
     char * key,
     char * value)
-{   
+{
     line_status sta ;
     char        line[ASCIILINESZ+1];
@@ -519,5 +549,5 @@
     } else if (line[0]=='#' || line[0]==';') {
         /* Comment line */
-        sta = LINE_COMMENT ; 
+        sta = LINE_COMMENT ;
     } else if (line[0]=='[' && line[len-1]==']') {
         /* Section name */
Index: /libmpc/trunk/mpcchap/iniparser.h
===================================================================
--- /libmpc/trunk/mpcchap/iniparser.h	(revision 392)
+++ /libmpc/trunk/mpcchap/iniparser.h	(revision 393)
@@ -82,6 +82,37 @@
 
 
-
+/*-------------------------------------------------------------------------*/
+/**
+@brief    Get number of keys for section n in a dictionary.
+@param    d   Dictionary to examine
+@param    n   Section number (from 0 to nsec-1).
+@return   Number of keys in section
+
+  This function locates the n-th section in a dictionary and returns
+  the number of keys in this section.
+
+  This function returns -1 in case of error.
+ */
+/*--------------------------------------------------------------------------*/
 int iniparser_getnkey(dictionary * d, int nsec);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+@brief    Get key and string for key nkey in section nsec in a dictionary.
+@param    d   Dictionary to examine
+@param    nsec   Section number.
+@param    nkey   Key number.
+@param    string   Pointer where the string will be returned.
+@return   Pointer to char string
+
+  This function locates the nkey-th key in the nsec-th section in a dictionary
+  and returns the key name and the key string as a pointer to strings
+  statically allocated inside the dictionary.
+  Do not free or modify the returned strings!
+
+  This function returns NULL in case of error.
+ */
+/*--------------------------------------------------------------------------*/
 char * iniparser_getkeyname(dictionary * d, int nsec, int nkey, char ** string);
 
