source: trunk/man/arm_get_error_message.3 @ 704

Revision 614, 3.3 KB checked in by dcarter, 4 years ago (diff)

see #111 - Build beta3

Line 
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
8arm_get_error_message \- get error message
9.SH SYNOPSIS
10.B #include <arm4.h>
11.sp
12\fBarm_error_t
13.br
14arm_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
23code.
24
25ARM implementations return values that are specific to the implementation. The only enforced
26convention is that a return code of zero indicates that no errors are reported (though an error
27could have occurred), and a negative return code indicates that some error occurred. Some
28implementations may report an error at times when another implementation would not.
29
30To 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
32specified error code. The ARM library is not obliged to return a message, even if it returned a
33non-zero return code.
34
35\fIcharset\fR is an IANA (Internet Assigned Numbers Authority \- see www.iana.org) MIBenum
36value [see \fBarm_is_charset_supported()\fR]. If a non-null message is returned, it will
37be in this encoding. It is strongly recommended that no value be used for \fIcharset\fR
38that 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
44character) into which the null-terminated error message will be copied. The
45message will be in the encoding specified by the \fIcharset\fR parameter. If the
46implementation cannot honor the request, the implementation must store at least the
47null termination character (e.g., which it would do if it does not return a message or
48does not recognize the error code or cannot return the message in the application's
49encoding). The function is ignored if the pointer is null and an error status may be
50returned.
51.SH "RETURN VALUE"
52On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates
53an error.
54.SH ERRORS
55If the return code is negative, an error occurred. If the return code is not negative, an error may
56or may not have occurred - the determination of what is an error and whether an error code is
57returned is at the discretion of the ARM implementation. The application can test the return code
58if it wants to provide its own error logging.
59
60The following errors are recognized by this implementation, but may not be portable to other implementations:
61
62.TP
63.B ARM_FAILURE_NULL_ARGUMENT
64The \fImsg\fR must not be null.
65.TP
66.B ARM_FAILURE_UNSUPPORTED_CHARSET
67The \fIcharset\fR requested isn't supported.
68.SH "CONFORMING TO"
69ARM Issue 4.0 C Language Bindings, Version 2
70.SH EXAMPLE
71None.
72.SH "SEE ALSO"
73.BR arm_is_charset_supported (3)
Note: See TracBrowser for help on using the repository browser.