int Ini_ReadGeneric (IniText handle, Ini_InputFunc inputFunction, void *inputSource);
Reads the tag/value pairs into the list identified by handle from the specified inputSource by calling the specified inputFunction.
This function allows you to read into memory data from any source, such as a memory mapped file or a TCP/IP address.
If you want to read from a disk file, you can use the function Ini_ReadFromFile.
Input | ||||
Name | Type | Description | ||
handle | IniText | A handle returned from Ini_New. It represents the list of in-memory tag/value pairs. | ||
inputFunction | Ini_InputFunc | A pointer to a callback function that is called to read in each line of the IniText. The prototype for the callback function is: int CVICALLBACK InputFunc(void *inputSource, char *inputBuffer, int maxLineLength, int *endOfSource, int *lineNumRead); The callback function should return 0 if it successfully reads a line of text. Otherwise, it should return a negative error code, which is then returned by Ini_ReadGeneric. The callback function should copy the line that it reads into the inputBuffer parameter as a NULL terminated string. The maxLineLength parameter specifies the maximum number of characters (not including the NULL byte) that can be safely copied into the inputBuffer. If your inputFunction encounters a line longer than this limit, it can return a negative error code or it can discard the extra characters. The default maximum line length is 255, which is specified as a macro in inifile.c. The callback function should set the *endOfSource parameter to a non-zero value if there may be further lines to read. The callback function should set the *lineNumRead parameter to the 1–based index of the line that was read. If this information is not needed, *lineNumRead can be set to zero. |
||
inputSource | void * | A value representing the input source. This value is passed to the specified input function.
|
Name | Type | Description | ||||||||||||||||||||
status | integer | Indicates whether the function was successful. A zero indicates success. A negative value indicates an error. If the value is from If the specified input function returns a negative value, the value is returned by Ini_ReadGeneric. Among the more commonly encountered errors are:
|