source: trunk/man/arm_register_application.3 @ 704

Revision 614, 5.5 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_register_application" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual"
7.SH NAME
8arm_register_application \- describe application
9.SH SYNOPSIS
10.B #include <arm4.h>
11.sp
12\fBarm_error_t
13.br
14arm_register_application(
15.br
16    const arm_char_t *\fIapp_name\fB,
17.br
18    const arm_id_t *\fIinput_app_id\fB,
19.br
20    const arm_int32_t \fIflags\fB,
21.br
22    const arm_buffer4_t *\fIbuffer4\fB,
23.br
24    arm_id_t *\fIoutput_app_id\fB);\fR
25.SH DESCRIPTION
26\fBarm_register_application()\fR describes metadata about an application.
27
28The application uses \fBarm_register_application()\fR to inform the ARM library of metadata about
29the application. This metadata does not change from one application instance to another. It
30contains part of the function of the ARM 2.0 call \fBarm_init()\fR; \fBarm_start_application()\fR contains
31the other part.
32
33ARM generates an ID that is passed in \fBarm_register_transaction()\fR and \fBarm_start_application()\fR.
34
35\fIapp_name\fR is a pointer to a null-terminated string containing the name of the application. The
36maximum length of the name is 128 characters, including the termination character.
37It serves no purpose and is illegal to make this call if the pointer is null. A name
38should be chosen that is unique, so generic names that might be used by a different
39development team, such as "Payroll Application", should not be used. The name
40should not contain trailing blank characters or consist of only blank characters. If
41the application has a copyrighted product name, the copyrighted name would be a
42good choice.
43
44\fIbuffer4\fR is a pointer to the user data buffer, if any. If the pointer is null (\fBARM_BUF4_NONE\fR),
45there is no buffer. The sub-buffer formats that might be used are
46\fBarm_subbuffer_app_identity_t\fR and \fBarm_subbuffer_encoding_t\fR.
47 
48\fIflags\fR contains 32-bit flags. No values are currently defined. The field should be zero
49(\fBARM_FLAG_NONE\fR).
50
51\fIinput_app_id\fR is a pointer to an optional 128-bit ID (16 bytes) that is unique and that can be treated as
52an alias for the other metadata. It can be any value except all zeros or all ones. If the
53pointer is null (\fBARM_ID_NONE\fR), no ID is provided.
54 
55An ID is unique if the probability of the ID being associated with more than one set
56of metadata is vanishingly small. The selection of 128-bit IDs yields 3.4 x 10**38
57unique IDs, so the objective is to select an ID that makes use of all 128 bits and is
58reasonably likely to not be selected by another person creating an ID of the same
59form. Two suggested algorithms that generate 128-bit values with these
60characteristics are:
61 
62.IP 1.
63The Universal Unique Identifier (UUID) algorithm that is part of The Open
64Group specification: DCE 1.1: Remote Procedure Call. A developer could use the
65algorithm at the time the application is developed using a utility on his or her
66system, and be reasonably certain that nobody else would generate the same 128-bit
67ID.
68 
69.IP 2.
70The MD5 Message-Digest Algorithm, described in IETF RFC 1321. Applying
71this algorithm to a concatenation of all the metadata properties would almost
72certainly result in a value that would not collide with any other ID created with a
73different set of metadata properties.
74.P
75If an ARM implementation is passed an ID that was previously registered within
76this process, the implementation can ignore the other metadata parameters and
77assume they are identical to the previously registered metadata. The application
78metadata consists of the following fields: \fIapp_name\fR and the
79\fBarm_subbuffer_app_identity_t\fR sub-buffer passed in \fIbuffer4\fR.
80
81\fIoutput_app_id\fR is a pointer to a 16-byte field. ARM will store a 16-byte value. There are no
82requirements on what value it is set to, except that it must be possible to pass it on
83other calls, such as \fBarm_start_application()\fR, without the application needing to do
84any error checking.
85.SH "RETURN VALUE"
86On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates
87an error.
88.SH ERRORS
89If the return code is negative, an error occurred. If the return code is not negative, an error may
90or may not have occurred - the determination of what is an error and whether an error code is
91returned is at the discretion of the ARM implementation. The application can test the return code
92if it wants to provide its own error logging.
93
94The following errors are recognized by this implementation, but may not be portable to other implementations:
95
96.TP
97.B ARM_FAILURE_NULL_ARGUMENT
98The \fIoutput_app_id\fR must not be null.
99.TP
100.B ARM_FAILURE_INVALID_ARGUMENT
101The \fIapp_name\fR parameter is invalid.
102.TP
103.B ARM_FAILURE_UNSUPPORTED_CHARSET
104The character set value passed in as a \fBarm_subbuffer_encoding_t\fR isn't supported.
105.TP
106.B ARM_FAILURE_BAD_ALIAS
107The alias provided contains all 0's or all 1's.
108.TP
109.B ARM_FAILURE_DUPLICATE_ALIAS
110The alias provided already refers to an application with different metadata.
111.TP
112.B ARM_FAILURE_INTERNAL_ERROR
113An internal error has occurred that prevented the application from being registered. Check your
114system log for more details.
115.SH "CONFORMING TO"
116ARM Issue 4.0 C Language Bindings, Version 2
117.SH EXAMPLE
118None.
119.SH "SEE ALSO"
120.BR arm_destroy_application (3),
121.BR arm_register_transaction (3),
122.BR arm_start_application (3)
Note: See TracBrowser for help on using the repository browser.