1 | /********************************************************************************** |
2 | * _iniPropertyRead |
3 | * |
4 | * |
5 | * |
6 | ************************************************** |
7 | * This code was created by Peter Harvey @ CodeByDesign. |
8 | * Released under LGPL 28.JAN.99 |
9 | * |
10 | * Contributions from... |
11 | * ----------------------------------------------- |
12 | * Peter Harvey - pharvey@codebydesign.com |
13 | **************************************************/ |
14 | |
15 | #include <config.h> |
16 | #include "ini.h" |
17 | |
18 | int _iniPropertyRead( HINI hIni, char *szLine, char *pszPropertyName, char *pszPropertyValue ) |
19 | { |
20 | |
21 | /* SANITY CHECKS */ |
22 | if ( hIni == NULL ) |
23 | return INI_ERROR; |
24 | if ( hIni->hCurObject == NULL ) |
25 | return INI_ERROR; |
26 | |
27 | /* SCAN LINE TO EXTRACT PROPERTY NAME AND VALUE WITH NO TRAILING SPACES */ |
28 | strcpy( pszPropertyName, "" ); |
29 | strcpy( pszPropertyValue, "" ); |
30 | |
31 | iniElement( szLine, '=', '\0', 0, pszPropertyName, INI_MAX_PROPERTY_NAME ); |
32 | iniElementToEnd( szLine, '=', '\0', 1, pszPropertyValue, INI_MAX_PROPERTY_VALUE ); |
33 | iniAllTrim( pszPropertyName ); |
34 | iniAllTrim( pszPropertyValue ); |
35 | |
36 | return INI_SUCCESS; |
37 | } |
38 | |
39 | |
40 | |