| 1 | .\" Copyright (c) 2005-2008 David Carter <dcarter@arm4.org> and others. |
|---|
| 2 | .\" All rights reserved. This program and the accompanying materials |
|---|
| 3 | .\" are made available under the terms of the Eclipse Public License v1.0 |
|---|
| 4 | .\" which accompanies this distribution, and is available at |
|---|
| 5 | .\" http://www.eclipse.org/legal/epl-v10.html |
|---|
| 6 | .TH "arm_get_error_message" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual" |
|---|
| 7 | .SH NAME |
|---|
| 8 | arm_get_error_message \- get error message |
|---|
| 9 | .SH SYNOPSIS |
|---|
| 10 | .B #include <arm4.h> |
|---|
| 11 | .sp |
|---|
| 12 | \fBarm_error_t |
|---|
| 13 | .br |
|---|
| 14 | arm_get_error_message( |
|---|
| 15 | .br |
|---|
| 16 | const arm_charset_t \fIcharset\fB, |
|---|
| 17 | .br |
|---|
| 18 | const arm_error_t \fIcode\fB, |
|---|
| 19 | .br |
|---|
| 20 | arm_message_buffer_t \fImsg\fB);\fR |
|---|
| 21 | .SH DESCRIPTION |
|---|
| 22 | \fBarm_get_error_message()\fR stores a string containing an error message for the specified error |
|---|
| 23 | code. |
|---|
| 24 | |
|---|
| 25 | ARM implementations return values that are specific to the implementation. The only enforced |
|---|
| 26 | convention is that a return code of zero indicates that no errors are reported (though an error |
|---|
| 27 | could have occurred), and a negative return code indicates that some error occurred. Some |
|---|
| 28 | implementations may report an error at times when another implementation would not. |
|---|
| 29 | |
|---|
| 30 | To help an application developer or administrator understand what a negative error code means, |
|---|
| 31 | \fBarm_get_error_message()\fR can be used to store a string containing an error message for the |
|---|
| 32 | specified error code. The ARM library is not obliged to return a message, even if it returned a |
|---|
| 33 | non-zero return code. |
|---|
| 34 | |
|---|
| 35 | \fIcharset\fR is an IANA (Internet Assigned Numbers Authority \- see www.iana.org) MIBenum |
|---|
| 36 | value [see \fBarm_is_charset_supported()\fR]. If a non-null message is returned, it will |
|---|
| 37 | be in this encoding. It is strongly recommended that no value be used for \fIcharset\fR |
|---|
| 38 | that has not been tested for support by the library using |
|---|
| 39 | \fBarm_is_charset_supported()\fR. |
|---|
| 40 | |
|---|
| 41 | \fIcode\fR is an error code returned as \fBarm_error_t\fR from an API call. |
|---|
| 42 | |
|---|
| 43 | \fImsg\fR is a pointer to a buffer that can contain 256 characters (including the termination |
|---|
| 44 | character) into which the null-terminated error message will be copied. The |
|---|
| 45 | message will be in the encoding specified by the \fIcharset\fR parameter. If the |
|---|
| 46 | implementation cannot honor the request, the implementation must store at least the |
|---|
| 47 | null termination character (e.g., which it would do if it does not return a message or |
|---|
| 48 | does not recognize the error code or cannot return the message in the application's |
|---|
| 49 | encoding). The function is ignored if the pointer is null and an error status may be |
|---|
| 50 | returned. |
|---|
| 51 | .SH "RETURN VALUE" |
|---|
| 52 | On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates |
|---|
| 53 | an error. |
|---|
| 54 | .SH ERRORS |
|---|
| 55 | If the return code is negative, an error occurred. If the return code is not negative, an error may |
|---|
| 56 | or may not have occurred - the determination of what is an error and whether an error code is |
|---|
| 57 | returned is at the discretion of the ARM implementation. The application can test the return code |
|---|
| 58 | if it wants to provide its own error logging. |
|---|
| 59 | |
|---|
| 60 | The following errors are recognized by this implementation, but may not be portable to other implementations: |
|---|
| 61 | |
|---|
| 62 | .TP |
|---|
| 63 | .B ARM_FAILURE_NULL_ARGUMENT |
|---|
| 64 | The \fImsg\fR must not be null. |
|---|
| 65 | .TP |
|---|
| 66 | .B ARM_FAILURE_UNSUPPORTED_CHARSET |
|---|
| 67 | The \fIcharset\fR requested isn't supported. |
|---|
| 68 | .SH "CONFORMING TO" |
|---|
| 69 | ARM Issue 4.0 C Language Bindings, Version 2 |
|---|
| 70 | .SH EXAMPLE |
|---|
| 71 | None. |
|---|
| 72 | .SH "SEE ALSO" |
|---|
| 73 | .BR arm_is_charset_supported (3) |
|---|