| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Many functions in FreeMD can return an error if they fail. For this reason, the application should always catch the error condition and take appropriate measures, for example by releasing the resources and passing the error up to the caller, or by displaying a descriptive message to the user and cancelling the operation.
Some error values do not indicate a system error or an error in the operation, but the result of an operation that failed properly. Such cases are described in the documentation of those functions.
3.1 Error Values A list of all error values used. 3.2 Error Strings How to get a descriptive string from a value.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
freemd_error_t type specifies the set of all error values
that are used by FreeMD. Possible values are:
FREEMD_ERR_OK
0.
FREEMD_ERR_SYSTEM
FREEMD_ERR_INVALID_ARGUMENT
FREEMD_ERR_SYNTAX
FREEMD_ERR_DEVICE
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
freemd_strerror returns a pointer to a statically
allocated string containing a description of the error with the error
value err. This string can be used to output a diagnostic
message to the user.
The following example illustrates the use of freemd_strerror:
freemd_error_t err = freemd_init ();
if (err)
{
fprintf (stderr, "%s: initializing FreeMD failed: %s\n",
argv[0], freemd_strerror (err));
exit (1);
}
|
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |