Ini_GetData

int Ini_GetData (IniText handle, const char sectionName[], const char tagName[], unsigned char **data, long *dataSize);

Purpose

Obtains a copy of the data block associated with tagName in the section identified by sectionName.

You are responsible for freeing the data.

Parameters

Input
Name Type Description
handle IniText A handle returned from Ini_New. It represents the list of in-memory tag/value pairs.
sectionName const char [] The section name under which to find the tag/value pair.
tagName const char [] The tag name in the tag/value pair.
Output
Name Type Description
data unsigned char ** The pointer variable into which the address of a dynamically allocated copy of the data associated with tagName is placed. You are responsible for freeing the data by calling the free function.

If an error occurs or the Tag Name cannot be found in the section, the pointer is set to NULL.
dataSize long * Returns the size of the data in bytes.

You may pass 0 (NULL) for this parameter if you do not need this information.

Return Value

Name Type Description
status integer Indicates whether a tag/data pair was found with the specified tagName in the section specified by sectionName.

A positive return value indicates that a tag/data pair was found.

If the tag's value is empty, such as in

tag 1 =

no tag/value pair is found.

A zero indicates that no tag/data pair was found.

A negative value indicates an error. If the value is from –1 to –999, it is one of the error values defined in userint.h. If the value is from –5000 to –5999, it is one of the error values defined in toolbox.h.

For this function, the only error you are likely to encounter is:
–12 Out of memory!