Changeset 2065 in orxonox.OLD for orxonox/branches
- Timestamp:
- Jul 3, 2004, 1:59:21 PM (20 years ago)
- Location:
- orxonox/branches/chris/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/ini_parser.cc
r2064 r2065 66 66 if( sscanf (linebuffer, "[%s", secbuffer) == 1) 67 67 { 68 if( ptr = strchr( secbuffer, ']') != NULL)68 if( (ptr = strchr( secbuffer, ']')) != NULL) 69 69 { 70 70 *ptr = 0; … … 114 114 } 115 115 116 char* IniParser::getVar( char* name, char* section, char* defvalue = "") 117 { 118 strcpy (internbuf, defvalue); 119 if( getSection (section) == -1) return internbuf; 120 121 char namebuf[PARSELINELENGHT]; 122 char valuebuf[PARSELINELENGHT]; 123 124 while( nextVar (namebuf, valuebuf) != -1) 125 { 126 if( !strcmp (name, namebuf)) 127 { 128 strcpy (internbuf, valuebuf); 129 return internbuf; 130 } 131 } 132 return internbuf; 133 } -
orxonox/branches/chris/src/ini_parser.h
r2064 r2065 17 17 FILE* stream; 18 18 bool bInSection; 19 char internbuf[PARSELINELENGHT]; 19 20 20 21 public: … … 22 23 ~IniParser (); 23 24 24 int openFile( char* name); 25 char* getVar( char* name, char* section, char* defvalue); 26 int openFile( char* name); 25 27 int getSection( char* section); 26 28 int nextVar( char* name, char* value);
Note: See TracChangeset
for help on using the changeset viewer.