Prosody high level BFILE play/record: API: sm_replay_bfile_start

Prototype Definition

int sm_replay_bfile_start(struct sm_bfile_replay_parms *file_parms)

Parameters

*file_parms
a structure of the following type:
typedef struct sm_bfile_replay_parms {
	BFILE *fd;						/* in */
	tSM_UT32 offset;					/* in */
	SM_REPLAY_PARMS replay_parms;				/* in */
	int status;						/* out */
	tSM_UT32 private_length;				/* out */
	int completing;						/* out */
	int data_length_in_buffer;				/* out */
	char buffer[kSMMaxHBReplayDataBufferSize];		/* out */
} SM_BFILE_REPLAY_PARMS;

Description

Prepares a channel for replay of data from a file to an output channel previously allocated by a call to sm_channel_alloc_placed().

The fields of the structure replay_parms should be set up as described in sm_replay_start() low level API call. Note the field data_length should either be set to zero or to the actual number of octets to be replayed from the file. If it is set to zero then all of the data starting from offset to the end of the file will be replayed.

The status field is used to indicate the current status of the replay. On return from a successful invocation of sm_replay_bfile_start() it will be set to a value of ERR_SM_PENDING and will continue to have this value until replay has been completed, aborted or terminated on occurrence of an error.

The fields private_length, data_length_in_buffer and buffer are used internally by the high level library and should not be accessed by the application.

The replay is finished when a call to sm_replay_bfile_complete() returns.

Fields

fd
The file containing the data to be played, which must have been opened with the bfile library.
offset
The offset measured in octets (starting from zero) of the first octet of replay data in the file referenced by fd.
replay_parms
A structure as defined for sm_replay_start.
status
The status of the replay.
private_length
A field reserved for the library.
completing
A field reserved for the library.
data_length_in_buffer
A field reserved for the library.
buffer
A field reserved for the library.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody high level BFILE play/record API.