Cart Contact NSDSP Home

hex_map_read_fd

This function builds a Hex Map from a HEX file. Unlike hex_map_read, it requires an open file handle, and may be used to read from standard input.

Syntax

hex_map_t hex_map_read_fd(
        int               file_handle,
        char*             error
);

Parameters

file_handle - an open file handle to be used to read the file

On Windows, the file handle parameter has HANDLE type and may be obtained with CreateFile or GetStdHandle Windows API functions.

error - the buffer that will be filled with an error message if the operation fails. The buffer must be at least 512 characters long.

Return

The function returns the Hex Map object read from the HEX file, or NULL in case of failure.

Notes

The function verifies the integrity of the HEX file, and reports errors if there are syntax errors or discrepancies. The function normalizes the resulting Hex Map object.

The function will continue reading to the end of the file, and then close the file handle passed to it.

On Windows, there are two versions of this function - hex_map_read_fd_a (for ASCII) and hex_map_read_fd_w (for UNICODE). The "nsdspif.h" file maps hex_map_read_fd to one of these functions depending on whether UNICODE is defined or not.

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

© 2007-2025 Northern Software Inc. All Rights Reserved.