Removed incomplete file search tool. It was in "contrib"
[AROS-Contrib.git] / libini / iniPropertySeek.c
blob996d1a4fba54159e5f58ee3057ec5ec7338c40af
1 /**********************************************************************************
2 * iniPropertySeek
5 **************************************************
6 * This code was created by Peter Harvey @ CodeByDesign.
7 * Released under LGPL 28.JAN.99
9 * Contributions from...
10 * -----------------------------------------------
11 * Peter Harvey - pharvey@codebydesign.com
12 **************************************************/
14 #include "inifile_intern.h"
15 #include "ini.h"
16 #include <aros/libcall.h>
18 /*****************************************************************************
19 NAME */
20 AROS_LH4(int, iniPropertySeek,
22 /* SYNOPSIS */
23 AROS_LHA(HINI, hIni, D0),
24 AROS_LHA(char *, pszObject, A0),
25 AROS_LHA(char *, pszProperty, A1),
26 AROS_LHA(char *, pszValue, A2),
28 /* LOCATION */
29 struct Library *, inifileBase, 37, inifile)
31 /* FUNCTION
33 INPUTS
35 RESULT
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 HISTORY
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 /* SANITY CHECKS */
54 if ( hIni == NULL )
55 return INI_ERROR;
57 /* Ok */
58 iniObjectFirst( hIni );
59 while ( iniObjectEOL( hIni ) != TRUE )
61 if ( pszObject[0] == '\0' || strcasecmp( pszObject, hIni->hCurObject->szName ) == 0 )
63 /* EITHER THE OBJECT HAS BEEN FOUND OR THE OBJECT DOES NOT MATTER */
64 /* IN ANYCASE LETS SCAN FOR PROPERTY */
65 iniPropertyFirst( hIni );
66 while ( iniPropertyEOL( hIni ) != TRUE )
68 if ( pszProperty[0] == '\0' || strcasecmp( pszProperty, hIni->hCurProperty->szName ) == 0 )
70 if ( pszValue[0] == '\0' || strcasecmp( pszValue, hIni->hCurProperty->szValue ) == 0 )
72 /* FOUND IT !! */
73 return INI_SUCCESS;
76 iniPropertyNext( hIni );
78 if ( pszObject[0] != '\0' )
80 hIni->hCurObject = NULL;
81 return INI_NO_DATA;
84 iniObjectNext( hIni );
87 return INI_NO_DATA;
89 AROS_LIBFUNC_EXIT
90 } /* iniPropertySeek */