arm_get_error_message

Langue: en

Version: August 2008 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

arm_get_error_message - get error message

SYNOPSIS

#include <arm4.h>

arm_error_t
arm_get_error_message(

    const arm_charset_t 
charset,

    const arm_error_t 
code

    arm_message_buffer_t 
msg);

DESCRIPTION

arm_get_error_message() stores a string containing an error message for the specified error code.

ARM implementations return values that are specific to the implementation. The only enforced convention is that a return code of zero indicates that no errors are reported (though an error could have occurred), and a negative return code indicates that some error occurred. Some implementations may report an error at times when another implementation would not.

To help an application developer or administrator understand what a negative error code means, arm_get_error_message() can be used to store a string containing an error message for the specified error code. The ARM library is not obliged to return a message, even if it returned a non-zero return code.

charset is an IANA (Internet Assigned Numbers Authority - see www.iana.org) MIBenum value [see arm_is_charset_supported()]. If a non-null message is returned, it will be in this encoding. It is strongly recommended that no value be used for charset that has not been tested for support by the library using arm_is_charset_supported().
  code is an error code returned as arm_error_t from an API call.
  msg is a pointer to a buffer that can contain 256 characters (including the termination character) into which the null-terminated error message will be copied. The message will be in the encoding specified by the charset parameter. If the implementation cannot honor the request, the implementation must store at least the null termination character (e.g., which it would do if it does not return a message or does not recognize the error code or cannot return the message in the application's encoding). The function is ignored if the pointer is null and an error status may be returned.

RETURN VALUE

On success, the function returns ARM_SUCCESS. A non-zero value indicates an error.

ERRORS

If the return code is negative, an error occurred. If the return code is not negative, an error may or may not have occurred - the determination of what is an error and whether an error code is returned is at the discretion of the ARM implementation. The application can test the return code if it wants to provide its own error logging.

The following errors are recognized by this implementation, but may not be portable to other implementations:

ARM_FAILURE_NULL_ARGUMENT
The msg must not be null.
ARM_FAILURE_UNSUPPORTED_CHARSET
The charset requested isn't supported.

CONFORMING TO

ARM Issue 4.0 C Language Bindings, Version 2

EXAMPLE

None.

SEE ALSO

arm_is_charset_supported(3)