Enumerate next section of file.
DWORD CfgParEnumerate(
CFGFILE cFile,
LPCSTR szSection,
LPSTR pDest,
int* pLen
);
Parameters
cFile
- (in) File handle retrieved by previous CfgFileOpen with argument CFG_SECTION as type.
szSection
- (in) Name of section after which to look for the next section. May be NULL or an empty string, in which case the first section is located.
pDest
- (out) Pointer to buffer to receive the name. The buffer must be at least *pLen characters long. The terminating zero is stored in the buffer, so there must be space for that.
pLen
- (in, out) Pointer to a variable that is set to the size of the buffer before the call. On successful return, the variable now contains the length of the value (including terminating zero).
Return values
ECFG_OK for success or an error code on failure.
Remarks
Finds the first or next section in a configuration file. In case of ECFG_LIMIT the pLen contains the size of buffer needed, nothing is copied to the buffer.
Errors
ECFG_BADCFGFILE
- File handle out of range or invalid
ECFG_NOMORE
- There are no more parameters in the section
ECFG_LIMIT
- Size of buffer too small
ECFG_NOTFOUND
- Section name not found
ECFG_WRONGFILETYPE
- Wrong file type
See Also