Index: orxonox/trunk/src/lib/util/ini_parser.cc
===================================================================
--- orxonox/trunk/src/lib/util/ini_parser.cc	(revision 5014)
+++ orxonox/trunk/src/lib/util/ini_parser.cc	(revision 5015)
@@ -23,6 +23,4 @@
 #include "list.h"
 #include "stdlibincl.h"
-
-#include "resource_manager.h"
 #include "debug.h"
 
@@ -53,4 +51,7 @@
 }
 
+/**
+ * removes all the sections. This is like delete, but even cooler :)
+ */
 void IniParser::deleteSections()
 {
@@ -80,4 +81,6 @@
   }
   delete this->sections;
+  this->currentEntry = NULL;
+  this->currentSection = NULL;
   this->sections = NULL;
 }
@@ -88,20 +91,17 @@
  * @return true on success false otherwise;
 */
-bool IniParser::openFile(const char* filename)
+bool IniParser::openFile(const char* fileName)
 {
   FILE*    stream;           //!< The stream we use to read the file.
 
-
-  if( filename == NULL)
-    return false;
-  char* tmpName = ResourceManager::homeDirCheck(filename);
 
   if (sections != NULL)
     deleteSections();
-
-  if( (stream = fopen (tmpName, "r")) == NULL)
-  {
-    PRINTF(1)("IniParser could not open %s\n", filename);
-    delete tmpName;
+  if( fileName == NULL)
+    return false;
+
+  if( (stream = fopen (fileName, "r")) == NULL)
+  {
+    PRINTF(1)("IniParser could not open %s\n", fileName);
     return false;
   }
@@ -189,4 +189,5 @@
     {
       this->currentSection = sectionEnum;
+      this->currentEntry = NULL;
       delete sectionIt;
       return true;
@@ -200,4 +201,16 @@
 
 /**
+ * moves to the first section
+ */
+void IniParser::getFirstSection()
+{
+  if (this->sections)
+    this->currentSection = this->sections->firstElement();
+  else
+    this->currentSection = NULL;
+  this->currentEntry = NULL;
+}
+
+/**
  * searches the next section
  * @returns the name of the section if found, NULL otherwise
@@ -210,6 +223,12 @@
   {
     if (this->sections)
-      this->currentSection = sections->nextElement(this->currentSection);
-  }
+    {
+      if (this->currentSection == this->sections->lastElement())
+        this->currentSection = NULL;
+      else
+        this->currentSection = this->sections->nextElement(this->currentSection);
+    }
+  }
+
   if (this->currentSection != NULL)
     return this->currentSection->name;
@@ -219,22 +238,28 @@
 
 /**
+ * moves to the first Variable of the current Section
+ */
+void IniParser::getFirstVar()
+{
+  if (this->currentSection)
+    this->currentEntry = this->currentSection->entries->firstElement();
+  else
+    this->currentEntry = NULL;
+}
+
+/**
  *  gets the next VarName=VarValue pair from the parsing stream
- * @param name: a pointer to the Name of the next Var
- * @param value: a pointer to the Value of the next Var
  * @return true on success, false otherwise (in the latter case name and value will be NULL)
  */
 bool IniParser::nextVar()
 {
-  if (this->currentSection == NULL)
-    return false;
-  if(this->currentEntry == this->currentSection->entries->lastElement())
+  if (this->currentSection == NULL
+      || this->currentEntry == NULL
+      || this->currentEntry == this->currentSection->entries->lastElement())
   {
     this->currentEntry = NULL;
     return false;
   }
-  if (this->currentEntry == NULL)
-    this->currentEntry = this->currentSection->entries->firstElement();
-  else
-    this->currentEntry = this->currentSection->entries->nextElement(this->currentEntry);
+  this->currentEntry = this->currentSection->entries->nextElement(this->currentEntry);
 
   if (this->currentEntry == NULL)
Index: orxonox/trunk/src/lib/util/ini_parser.h
===================================================================
--- orxonox/trunk/src/lib/util/ini_parser.h	(revision 5014)
+++ orxonox/trunk/src/lib/util/ini_parser.h	(revision 5015)
@@ -43,14 +43,23 @@
     bool openFile(const char* name);
 
-    bool getSection( const char* sectionName);
+    bool getSection(const char* sectionName);
+
+    void getFirstSection();
     const char* nextSection();
 
+    /** @returns true if the file is opened, false otherwise*/
     bool isOpen() const { return (sections != NULL)?true:false; };
 
     const char* getVar(const char* entryName, const char* sectionName, const char* defaultValue = "") const;
+
+    void getFirstVar();
     bool nextVar();
 
-    const char* getCurrentName() const { return (currentEntry!=NULL)?currentEntry->name:NULL; };
-    const char* getCurrentValue() const { return (currentEntry!=NULL)?currentEntry->value:NULL; };
+    /** @returns the name of the Current selected Section */
+    const char* getCurrentSection() const { return (this->currentSection!=NULL)?this->currentSection->name:NULL; };
+    /** @returns the current entries Name, or NULL if we havn't selected a Entry */
+    const char* getCurrentName() const { return (this->currentEntry!=NULL)?this->currentEntry->name:NULL; };
+    /** @returns the current entries Value, or NULL if we havn't selected a Entry */
+    const char* getCurrentValue() const { return (this->currentEntry!=NULL)?this->currentEntry->value:NULL; };
 
     void debug() const;
