Japanese
PROGRAMMER'S GUIDEStream system library
BackForward
stream system library

7.Function specification-9


7.9 Error handling


 one
View
table
 Title

function specification

 Function

Registering an error function

 Function name

STM_SetErrFunc

 No

9.1

Format
void STM_SetErrFunc(StmErrFunc func, void *obj)
input
 func
 :Error function (STM_ERR_NULLFUNC if canceling)
 obj
 :Registered object
output
none
function value
none
function
Register an error function for the stream system.
The registration function is called when a stream system error occurs.
remarks

  1. The registration function has the following format:
    void (*StmErrFunc)(void *obj, Sint32 ec)

  2. The registration object is passed to the first argument of the registration function, and the error code is passed to the second argument.

  3. Please also register the error function in the file system.


 one
View
table
 Title

function specification

 Function

Get error status

 Function name

STM_GetErrStat

 No

9.2

Format
void STM_GetErrStat(StmErrStat *stat)
input
none
output
stat: error status
function value
none
function
Gets the error status of the stream system.
remarks
Get the error status by calling it from the error function.

 one
View
table
 Title

function specification

 Function

Read error recovery

 Function name

STM_Recover

 No

9.3

Format
Sint32 STM_Recover(void)
input
none
output
none
function value
 STM_ERR_OK
 :Recovery successful
 STM_ERR_CDRD
 : Recovery failed
function
Forces playback to continue if a read error occurs.
remarks
Use it in your error function like this:
void errfunc(void *obj, Sint32 ec)
{
	if (ec == STM_ERR_CDRD) {
		STM_Recover();
	} else {
	・
	・
	・
	}
}

BackForward
PROGRAMMER'S GUIDEStream system library
Copyright SEGA ENTERPRISES, LTD., 1997