MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / IniSectionGetInt

Function IniSectionGetInt

src/Helpers.c:106–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106int IniSectionGetInt (
107 LPCWSTR lpCachedIniSection,
108 LPCWSTR lpName,
109 int iDefault )
110{
111 WCHAR *p = ( WCHAR * ) lpCachedIniSection;
112 WCHAR tch[256];
113 int ich;
114 int i;
115 if ( p ) {
116 lstrcpy ( tch, lpName );
117 lstrcat ( tch, L"=" );
118 ich = lstrlen ( tch );
119 while ( *p ) {
120 if ( StrCmpNI ( p, tch, ich ) == 0 ) {
121 if ( swscanf ( p + ich, L"%i", &i ) == 1 ) {
122 return ( i );
123 } else {
124 return ( iDefault );
125 }
126 } else {
127 p = StrEnd ( p ) + 1;
128 }
129 }
130 }
131 return ( iDefault );
132}
133
134
135BOOL IniSectionSetString ( LPWSTR lpCachedIniSection, LPCWSTR lpName, LPCWSTR lpString )

Callers 3

Style_LoadFunction · 0.85
LoadSettingsFunction · 0.85
LoadFlagsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected