General error handling functions

ticalcs_error_get

TIEXPORT3 int TICALL ticalcs_error_get(int number, char **message)

Attempt to match the message corresponding to the error number. The returned string must be freed when no longer needed. The error message has the following format: - 1: the error message - 2: the cause(s), explanations on how to fix it - 3: the error returned by the system

number :
error number (see error.h for list).
message :
a newly glib allocated string which contains corresponding error *message.
Return value :
0 if error has been caught, the error number otherwise (propagation).

ticalcs_error_free

TIEXPORT3 int TICALL ticalcs_error_free(char *message)

Free the given message string allocated by ticalcs_error_get();

message :
a message previously allocated by ticalcs_error_get()
Return value :
0 if the argument was valid and the message was freed, nonzero otherwise.

Return to the main index