Skip to content

Commit 64113ef

Browse files
committed
Updated and improved the documentation. Plus a few minor formatting changes.
1 parent 7790836 commit 64113ef

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

dev/minIni.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static int getkeystring(INI_FILETYPE *fp, const TCHAR *Section, const TCHAR *Key
234234
assert(fp != NULL);
235235
/* Move through file 1 line at a time until a section is matched or EOF. If
236236
* parameter Section is NULL, only look at keys above the first section. If
237-
* idxSection is postive, copy the relevant section name.
237+
* idxSection is positive, copy the relevant section name.
238238
*/
239239
len = (Section != NULL) ? (int)_tcslen(Section) : 0;
240240
if (len > 0 || idxSection >= 0) {
@@ -449,7 +449,7 @@ int ini_getkey(const TCHAR *Section, int idx, TCHAR *Buffer, int BufferSize, co
449449
/** ini_browse()
450450
* \param Callback a pointer to a function that will be called for every
451451
* setting in the INI file.
452-
* \param UserData arbitrary data, which the function passes on the the
452+
* \param UserData arbitrary data, which the function passes on the
453453
* \c Callback function
454454
* \param Filename the name and full path of the .ini file to read from
455455
*

dev/minIni.h

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,33 +115,38 @@ int ini_browse(INI_CALLBACK Callback, void *UserData, const mTCHAR *Filename);
115115
#endif
116116

117117
#if ! defined INI_READONLY
118-
bool put(const std::string& Section, const std::string& Key, long Value) const
118+
bool put(const std::string& Section, const std::string& Key, long Value)
119119
{ return ini_putl(Section.c_str(), Key.c_str(), Value, iniFilename.c_str()) != 0; }
120120

121-
bool put(const std::string& Section, const std::string& Key, int Value) const
121+
bool put(const std::string& Section, const std::string& Key, int Value)
122122
{ return ini_putl(Section.c_str(), Key.c_str(), (long)Value, iniFilename.c_str()) != 0; }
123123

124-
bool put(const std::string& Section, const std::string& Key, bool Value) const
124+
bool put(const std::string& Section, const std::string& Key, bool Value)
125125
{ return ini_putl(Section.c_str(), Key.c_str(), (long)Value, iniFilename.c_str()) != 0; }
126126

127-
bool put(const std::string& Section, const std::string& Key, const std::string& Value) const
127+
bool put(const std::string& Section, const std::string& Key, const std::string& Value)
128128
{ return ini_puts(Section.c_str(), Key.c_str(), Value.c_str(), iniFilename.c_str()) != 0; }
129129

130-
bool put(const std::string& Section, const std::string& Key, const char* Value) const
130+
bool put(const std::string& Section, const std::string& Key, const char* Value)
131131
{ return ini_puts(Section.c_str(), Key.c_str(), Value, iniFilename.c_str()) != 0; }
132132

133133
#if defined INI_REAL
134-
bool put(const std::string& Section, const std::string& Key, INI_REAL Value) const
134+
bool put(const std::string& Section, const std::string& Key, INI_REAL Value)
135135
{ return ini_putf(Section.c_str(), Key.c_str(), Value, iniFilename.c_str()) != 0; }
136136
#endif
137137

138-
bool del(const std::string& Section, const std::string& Key) const
138+
bool del(const std::string& Section, const std::string& Key)
139139
{ return ini_puts(Section.c_str(), Key.c_str(), 0, iniFilename.c_str()) != 0; }
140140

141-
bool del(const std::string& Section) const
141+
bool del(const std::string& Section)
142142
{ return ini_puts(Section.c_str(), 0, 0, iniFilename.c_str()) != 0; }
143143
#endif
144144

145+
#if !defined INI_NOBROWSE
146+
bool browse(INI_CALLBACK Callback, void *UserData) const
147+
{ return ini_browse(Callback, UserData, iniFilename.c_str()) != 0; }
148+
#endif
149+
145150
private:
146151
std::string iniFilename;
147152
};

dev/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int main(void)
8888
printf("3. String writing tests passed\n");
8989

9090
/* section/key enumeration */
91-
printf("4. Section/key enumertion, file structure follows\n");
91+
printf("4. Section/key enumeration, file structure follows\n");
9292
for (s = 0; ini_getsection(s, section, sizearray(section), inifile) > 0; s++) {
9393
printf(" [%s]\n", section);
9494
for (k = 0; ini_getkey(section, k, str, sizearray(str), inifile) > 0; k++) {

doc/minIni.pdf

10.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)