# Ini_WriteGeneric

int Ini_WriteGeneric (IniText handle, Ini_OutputFunc outputFunction, void *outputDestination);

## Purpose

Writes the tag/value pairs in the list identified by handle to the specified outputDestination by calling the specified outputFunction.

This function allows you to write the in-memory contents to any destination, such as a memory mapped file or a TCP/IP address.

If you want to write to a disk file, you can use the function Ini_WriteToFile.

## Parameters

Input
Name | Type | Description
handle | IniText | A handle returned from Ini_New. It represents the list of in-memory tag/value pairs.
outputFunction | Ini_OutputFunc | A pointer to a callback function that is called to write out each line of the IniText. The prototype for the callback function is: int CVICALLBACK OutputFunc(void *outputDest, char *outputString); The callback function should return 0 if it successfully writes the outputString parameter. Otherwise, it should return a negative error code, which is then returned by Ini_WriteGeneric. Each call to the function represents one line. It is the responsibility of the function to mark the end of the line in a manner appropriate to the destination type.
outputDestination | void * | A value representing the output destination. This value is passed to the specified output function.
| Note This value can be used pass a pointer to a structure which contains the information necessary for the output function to write to a particular destination, such as a memory mapped file or a TCP/IP address.

## Return Value

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 –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. If the specified output function returns a negative value, the value is returned by Ini_WriteGeneric. Among the more commonly encountered errors are:
–12 | Out of memory!
–91 | Too many files are open.
–93 | Input/Output error.
–94 | File not found.
–95 | File access permission denied.
–99 | File already open.
–100 | Badly formed pathname.
–5003 | Could not generate an unused temporary file name in the same directory as the output file.
–5004 | Could not create a temporary file in the same directory as the output file.