Build Lunapaint from Contrib.
[AROS-Contrib.git] / libini / _iniDump.c
blobd8f7702e77277aa61ed29a87aeb2c65baeba7442
1 /**********************************************************************************
2 * _iniDump
4 * Dump contents to hStream.
6 * - iniCommit calls this. You can bypass iniCommit restrictions to get some debugging information by calling directly.
7 * - Make sure the stream is open before calling.
8 * - leaves list position at iniObjectFirst()
9 * - always returns true
11 **************************************************
12 * This code was created by Peter Harvey @ CodeByDesign.
13 * Released under LGPL 28.JAN.99
15 * Contributions from...
16 * -----------------------------------------------
17 * Peter Harvey - pharvey@codebydesign.com
18 **************************************************/
20 #include "inifile_intern.h"
21 #include "ini.h"
23 #undef _iniDump
24 int _iniDump( HINI hIni, FILE *hStream, struct Library *inifileBase )
27 /* SANITY CHECK */
28 if ( hIni == NULL )
29 return INI_ERROR;
31 if ( !hStream )
32 return INI_ERROR;
34 /* SCAN OBJECTS */
35 iniObjectFirst( hIni );
36 while ( iniObjectEOL( hIni ) == FALSE )
38 fprintf( hStream, "%c%s%c\n", hIni->cLeftBracket, hIni->hCurObject->szName, hIni->cRightBracket );
39 iniPropertyFirst( hIni );
40 while ( iniPropertyEOL( hIni ) == FALSE )
42 fprintf( hStream, "%s\t\t%c %s\n", hIni->hCurProperty->szName, hIni->cEqual, hIni->hCurProperty->szValue );
43 iniPropertyNext( hIni );
45 fprintf( hStream, "\n" );
46 iniPropertyFirst( hIni );
47 iniObjectNext( hIni );
49 iniObjectFirst( hIni );
51 return INI_SUCCESS;