PROGRAMMER'S GUIDEStream system library
BackForward
Stream system library

7. Function specifications-9


7.9 Error handling


 List
 Title

Function specifications

 Function

Error function registration

 Function Name

STM_SetErrFunc

 No

9.1

Form
void STM_SetErrFunc (StmErrFunc func, void * obj)
input
 func
 : Error function (STM_ERR_NULLFUNC to cancel)
 obj
 : Registered object
output
none
Function value
none
function
Register the 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 as the first argument of the registration function, and the error code is passed as the second argument.

  3. Also register the error function in the file system.


 List
 Title

Function specifications

 Function

Getting error status

 Function Name

STM_GetErrStat

 No

9.2

Form
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.

 List
 Title

Function specifications

 Function

Read error recovery

 Function Name

STM_Recover

 No

9.3

Form
Sint32 STM_Recover (void)
input
none
output
none
Function value
 STM_ERR_OK
 : Successful recovery
 STM_ERR_CDRD
 : Recovery failed
function
If a read error occurs, playback is forcibly continued.
remarks
Use it in the error function as follows:
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