Miles Sound System SDK 7.2a

AIL_file_fss_read

The function AIL_file_fss_read loads a data file spec into the specified memory address, optionally allocating the memory as well.

void * AIL_file_fss_read(
  FSSpec const * filename,
  void *dest
);

In Parameters

filename
specifies the data file spec that you'd like to read.

Out Parameters

dest
specifies the address of where you'd like the data loaded. If you pass in NULL for this parameter, then MSS will allocate the memory to hold the data file with AIL_mem_alloc_lock. You can also pass in the flag "FILE_READ_WITH_SIZE" for the dest parameter. This flag also tells MSS to allocate the memory to hold the data file, but, in addition, it will place the size of the data in the first four bytes of the buffer. This saves an extra call to the AIL_file_size function.

Returns

If *dest was NULL, then this function will return the pointer to the new memory block. If *dest was an address, then this function will just return *dest. If an error occurred, then this function will return NULL - use AIL_file_error and AIL_last_error to get the specific error.

Discussion

This function is only used on the Mac with the Classic or Carbon CFM libraries - the Mach-O version of Miles just uses normal Unix style slash separated string filenames.

If you use this function to allocate the memory for you, then you must free the pointer it returns with AIL_mem_free_lock or your application will leak.

This function must not be invoked from an interrupt-based callback function.


Group: Memory and File Services
Related Sections: Filenames on MacOS
Related Functions: AIL_WAV_file_fss_write, AIL_WAV_file_write, AIL_file_error, AIL_file_fss_attrib_write, AIL_file_fss_size, AIL_file_fss_write, AIL_file_read, AIL_file_size, AIL_last_error, AIL_mem_alloc_lock, AIL_mem_free_lock, AIL_set_file_callbacks
Related Basic Types: FSSpec, void, void *

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.