Previous | Contents | Index |
#include <mme/mme_api.h> MMRESULT APIENTRY mmioCreateChunk(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags); |
LPMMCKINFO lpck
Specifies a pointer to an MMCKINFO data structure that
was previously filled by the
mmioDescend
or the
mmioCreateChunk
function.
UINT uFlags
Specifies option flags for creating the new chunk.
The mmioCreateChunk function creates a new chunk in a RIFF file. The mmioCreateChunk function cannot insert a chunk into the middle of a file. If a chunk is created anywhere but at the end of a file, the mmioCreateChunk function overwrites existing information in the file.Extensions None.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMIOERR_CANNOTWRITE | The contents of the buffer could not be written to disk. |
MMIOERR_CANNOTSEEK | There was an error while seeking to the end. |
#include <mme/mme_api.h> MMRESULT APIENTRY mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, LPMMCKINFO lpckParent, UINT uFlags); |
LPMMCKINFO lpck
Specifies a pointer to an MMCKINFO data structure to
be filled by the
mmioDescend
function. See Section 6.2.1 for more information about the
MMCKINFO data structure.
LPMMCKINFO lpckParent
Specifies a pointer to an optional MMCKINFO data
structure that identifies the parent of the chunk being searched. A
parent of a chunk is the enclosing chunk; only
RIFF
and
LIST
chunks can be parents.
If the lpckParent argument is not NULL, then the mmioDescend function assumes that the MMCKINFO data structure it references was filled when the mmioDescend function was called to descend into the parent chunk. In this case, the mmioDescend function searches only for a chunk within the parent chunk. Set the lpckParent argument to NULL if no parent is being specified. See Section 6.2.1 for more information about the MMCKINFO data structure.
UINT uFlags
Specifies search options for a chunk. If no flags are specified,
mmioDescend
descends into the chunk at the current file position. The following
flags are defined:
MMIO_FINDCHUNK
Searches for a chunk with the specified chunk ID.
MMIO_FINDRIFF
Searches for a chunk with chunk ID RIFF and with the specified form type.
MMIO_FINDLIST
Searches for a chunk with chunk ID LIST and with the specified form type.
The mmioDescend function descends into a RIFF file chunk beginning at the current file position or searches for a specified chunk. When using the mmioDescend function to search for a chunk, position the file at the beginning of the chunk before calling the mmioDescend function. The search begins at the current file position and continues to the end of the file. If a parent chunk is specified, the file position should be within the parent chunk before calling the mmioDescend function. The search begins at the current file position and continues to the end of the parent chunk.Extensions None.If the mmioDescend function is unsuccessful in searching for a chunk, the current file position is undefined. If the mmioDescend function is successful, the current file position is changed. If the chunk is a RIFF or LIST chunk, the new file position is immediately after the form or list type (12 bytes from the beginning of the chunk). For other chunks, the new file position is at the start of the data portion of the chunk (8 bytes from the beginning of the chunk).
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns the following error code:
Error Code | Description |
---|---|
MMIOERR_CHUNKNOTFOUND | The end of the file or the end of the parent chunk was reached before the chunk was found. |
#include <mme/mme_api.h> MMRESULT APIENTRY mmioFlush(HMMIO hmmio, UINT uFlags); |
UINT uFlags
Not used, set to zero (0).
The mmioFlush function flushes any pending output to the hmmio file.Extensions None.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns the following error code:
Error Code | Description |
---|---|
MMIOERR_CANNOTWRITE | The contents of the buffer could not be written to disk. |
#include <mme/mme_api.h> FOURCC mmioFOURCC(CHAR ch0, CHAR ch1, CHAR ch2, CHAR ch3) |
The mmioFOURCC macro converts four characters into a four-character code. All characters must be specified because the macro does not pad any missing characters as the mmioStringToFOURCC function does.Extensions None.
Returns a four-character code created from the given four characters.
#include <mme/mme_api.h> HMMIO APIENTRY mmioOpen(LPSTR szFileName, LPMMIOINFO lpmmioinfo, DWORD dwOpenFlags); |
The file name should not be longer than 128 bytes, including the terminating NULL. The length of the path string cannot exceed PATH_MAX nor can a component exceed NAME_MAX.
LPMMIOINFO lpmmioinfo
This flag is not used; set it to NULL.
DWORD dwOpenFlags
Specifies options for opening the file. The following flags are defined:
MMIO_READ
Opens the file for reading only. This is the default flag if MMIO_WRITE and MMIO_READWRITE are not specified.
MMIO_WRITE
Opens the file for writing only. Do not read from a file opened in this mode.
MMIO_READWRITE
Opens the file for both reading and writing.
MMIO_CREATE
Creates a new file. If the file already exists, it is truncated to zero length. For memory files, MMIO_CREATE indicates that the end of the file is initially at the start of the buffer.
MMIO_DELETE
Deletes a file. If this flag is specified, the szFileName argument should not be NULL. The return value will be TRUE (cast to HMMIO) if the file was deleted successfully, and FALSE otherwise. Do not call the mmioClose function for a file that has been deleted. If this flag is specified, all other flags are ignored.
The mmioOpen function opens a file for unbuffered or buffered I/O.Extensions None.
Returns a file handle to the opened file. This handle is not an OpenVMS file handle; do not use it with any file I/O functions other than multimedia file I/O (mmio) functions. If the file cannot be opened, the return value is NULL. If the lpmmioinfo argument is not NULL, then the wError field of the MMIOINFO data structure contains error information returned by the I/O procedure.
#include <mme/mme_api.h> MMRESULT APIENTRY mmioRead(HMMIO hmmio, HPSTR pch, LONG cch); |
HPSTR pch
Specifies a pointer to a buffer containing the data read from the file.
LONG cch
Specifies the number of bytes to read from the file.
The mmioRead function reads a specified number of bytes from a file opened with the mmioOpen function.Extensions None.
Returns the value of the number of bytes actually read. If the end of the file has been reached and no more bytes can be read, the return value is 0. If there is an error reading from the file, the return value is --1.
#include <mme/mme_api.h> MMRESULT APIENTRY mmioRename(LPCSTR szFileName, LPCSTR szNewFileName, LPMMIOINFO lpmmioinfo, DWORD dwRenameFlags); |
LPCSTR szNewFileName
Specifies a pointer to a string containing the new file name.
LPMMIOINFO lpmmioinfo
This flag is not used; set it to NULL.
DWORD dwRenameFlags
Must be set to zero.
The mmioRename function renames a file.Extensions None.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMIOERR_CANNOTWRITE | The contents of the buffer could not be written to disk. |
MMIOERR_FILENOTFOUND | The file was not found. |
#include <mme/mme_api.h> MMRESULT APIENTRY mmioSeek(HMMIO hmmio, LONG lOffset, LONG iOrigin); |
LONG lOffset
Specifies an offset for changing the current position in the file.
LONG iOrigin
Specifies how the offset given by the lOffset argument is
interpreted. The following flags are defined:
SEEK_SET
Seeks to lOffset bytes from the beginning of the file.
SEEK_CUR
Seeks to lOffset bytes from the current file position.
SEEK_END
Seeks to lOffset bytes from the end of the file.
The mmioSeek function changes the current file position in a file opened with the mmioOpen function. The current file position is the location in the file where data is read or written.Extensions None.If seeking to an invalid location in a file, such as past the end of the file, the mmioSeek function might not return an error but subsequent I/O operations can fail. To locate the end of a file, call the mmioSeek function with the lOffset argument set to zero and the iOrigin argument set to SEEK_END.
Returns a new position specified in bytes, relative to the beginning of the file. If an error occurs, the return value is --1.
#include <mme/mme_api.h> FOURCC APIENTRY mmioStringToFOURCC(LPCSTR sz, UINT uFlags); |
UINT uFlags
Specifies options for the conversion. The following flags are defined:
MMIO_TOUPPER
Converts all characters to uppercase.
NULL
Does not convert characters to uppercase.
The mmioStringToFOURCC function converts a null-terminated string into a four-character code. The mmioStringToFOURCC function does not check to see if the sz argument follows conventions regarding legal characters to use in a four-character code. The string is copied to a four-character code and is either padded to the right with blanks or truncated to four characters, as required.Extensions None.
Returns the four-character code created from the given string.
#include <mme/mme_api.h> MMRESULT APIENTRY mmioWrite(HMMIO hmmio, HPSTR pch, LONG cch); |
HPSTR pch
Specifies a pointer to the buffer to be written to the file.
LONG cch
Specifies the number of bytes to write to the file.
The mmioWrite function writes a specified number of bytes to a file opened with the mmioOpen function. The current file position is incremented by the number of bytes written.Extensions None.
Returns the number of bytes actually written. If there is an error writing to the file, the return value is --1.
6.7 Multimedia File I/O Return Values
This section presents the multimedia file I/O return values or error
codes. Table 6-2 lists the codes that can be returned by one or
more of the file I/O functions.
Error Code | Description |
---|---|
MMIOERR_CANNOTCLOSE | Cannot close file. |
MMIOERR_CANNOTOPEN | Cannot open file. |
MMIOERR_CANNOTEXPAND | Cannot expand file. |
MMIOERR_CANNOTREAD | Cannot read file. |
MMIOERR_CANNOTSEEK | An error occurred while seeking to the end of the file. |
MMIOERR_CANNOTWRITE | The contents of the buffer could not be written to disk. |
MMIOERR_CHUNKNOTFOUND | The end of the file or the end of the parent chunk was reached before the chunk was found. |
MMIOERR_FILENOTFOUND | The file was not found. |
MMIOERR_OUTOFMEMORY | Out of memory. |
MMIOERR_UNBUFFERED | File is unbuffered. |
Previous | Next | Contents | Index |