|
|
cc [options] file -lmas#include <mas.h> int mas_errno(void); char *mas_errmsg(void); void mas_perror(void); void mas_error(char *func, char *str, int err, char *sysfunc);
mas_errno returns an error number associated with the last error encountered. mas_errmsg returns a pointer to a character string that briefly describes the error. mas_perror prints mas_errmsg to stderr. The error message, mas_errmsg, is of the form:
function: MAS_ERROR_CODE descriptionfunction: MAS_SYSERR description, system_call failed: errno string
where function is the name of the MAS function that encountered the error, MAS_ERROR_CODE is one of the error codes given below, and description is a brief string describing the error. In addition, if the error is MAS_SYSERR, indicating that an underlying system or library call has failed, system_call identifies the system or library call that failed, and errno is the error string as contained in sys_errlist.
If no error has been encountered by MAS, the error string is:
mas_error: MAS_SUCCESS no errors
The function mas_error is used internally by MAS to set error conditions. Normally, applications should not call mas_error.
mas_errno returns one of the MAS error codes given below.
mas_perror and mas_error have no return value.
Error Codes | Condition |
MAS_SUCCESS | no error was encountered |
MAS_ACCESS | unknown access method requested |
MAS_USAGE | invalid use of MAS functions |
MAS_INVALIDARG | an invalid argument to a MAS function was detected |
MAS_LIMIT | mas has encountered a storage limit |
MAS_NOFILEACCESS | MAS cannot open or create a file |
MAS_NOSUPPORT | the requested operation is not supported |
MAS_SANITY | an internal structure or object has failed a sanity check |
MAS_SYSERR | a system call has failed |
MAS_NOMETRIC | the requested metric is not present in the metric registration table |