Prosody generic: API: sm_error_name

Prototype Definition

char *sm_error_name(struct sm_error_name_parms *errp)

Parameters

*errp
a structure of the following type:
typedef struct sm_error_name_parms {
	tSM_INT code;						/* in */
	char name[80];						/* out */
} SM_ERROR_NAME_PARMS;

Description

Generates a name for the supplied Prosody error code. The name is one of the standard names, unless the error code is unrecognised, in which case a suitable representation is used.

Fields

code
The error code whose name is required.
name
The generated name.

Returns

Returns the address of the name field in the supplied parameter structure. This allows the function return value to be used as a parameter to another function call. For example:

printf("Error calling sm_replay_start(): %s\n", sm_error_name(&e));

Since this is never null, it can be safely used immediately. .


This function is part of the Prosody generic API.