piut_getprofile

This function retrieves an entry value as a character string from the specified section in the specified initialization file.

C format

int32 piut_getprofile(

char PIPTR * section,

char PIPTR * entry,

char PIPTR * default,

char PIPTR * buf,

int32 bufsize,

char PIPTR * file );

Returns

The number of bytes copied into buf, not including the null terminating character.

Arguments

section (passed)

Null-terminated string that specifies the section of the file containing the entry. This section name should not include the square brackets ("[]").

entry (passed)

Null-terminated string containing the entry whose associated string is to be retrieved

default (passed)

Null-terminated string that specifies the value for the given entry if the entry cannot be found

buf (returned)

Buffer that receives the character string

bufsize (passed)

Size in bytes of buf

file (passed)

Null-terminated string that identifies the initialization file

Usage Notes

This function is implemented on Microsoft Windows platforms as a macro for the native function GetPrivateProfileString.

The match on section and entry names is not case-sensitive.

The default string is returned if the section is absent, the entry is absent, or if the file is not found. In this case, the return code is set to the length of the default string.

If a NULL is passed as the section argument, all section names without the surrounding brackets and without leading or trailing spaces are returned in the buffer. Each section name is separated by a null character from the following section name and the list is terminated by two null characters.

If a NULL is passed as the entry argument, all entry names without the surrounding brackets and without leading or trailing spaces are returned in the buffer. Each entry name is separated by a null character from the following entry name and the list is terminated by two null characters.

Enabling Operational Intelligence