| 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_correlator_length" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual" |
|---|
| 7 | .SH NAME |
|---|
| 8 | arm_get_correlator_length \- get length of correlator |
|---|
| 9 | .SH SYNOPSIS |
|---|
| 10 | .B #include <arm4.h> |
|---|
| 11 | .sp |
|---|
| 12 | \fBarm_error_t |
|---|
| 13 | .br |
|---|
| 14 | arm_get_correlator_length( |
|---|
| 15 | .br |
|---|
| 16 | const arm_correlator_t *\fIcorrelator\fB, |
|---|
| 17 | .br |
|---|
| 18 | arm_correlator_length_t *\fIlength\fB);\fR |
|---|
| 19 | .SH DESCRIPTION |
|---|
| 20 | \fBarm_get_correlator_length()\fR returns the length of a correlator, based on the length field within |
|---|
| 21 | the correlator header. Note that this length is not necessarily the length of the buffer containing |
|---|
| 22 | the correlator. |
|---|
| 23 | |
|---|
| 24 | A correlator header contains a length field. \fBarm_get_correlator_length()\fR is used to return the |
|---|
| 25 | length. The function handles any required conversion from the network byte order used in the |
|---|
| 26 | header and the endian (big versus little) of the platform. See \fBarm_generate_correlator()\fR for a |
|---|
| 27 | description of a correlator. |
|---|
| 28 | |
|---|
| 29 | \fIcorrelator\fR is a pointer to a buffer containing a correlator. It serves no purpose to make the call if |
|---|
| 30 | the pointer is null. |
|---|
| 31 | |
|---|
| 32 | \fIlength\fR is a pointer to an \fBarm_correlator_length_t\fR (a 16-bit integer) into which the ARM |
|---|
| 33 | implementation will store the length. It serves no purpose to make the call if the |
|---|
| 34 | pointer is null. The stored value |
|---|
| 35 | will be the actual value if the value is apparently correct; otherwise, it will be zero. |
|---|
| 36 | Examples of when zero would be stored are when the input correlator pointer is null |
|---|
| 37 | or the length field is invalid, such as being greater than 512 |
|---|
| 38 | (\fBARM_CORR_MAX_LENGTH\fR) bytes. |
|---|
| 39 | .SH "RETURN VALUE" |
|---|
| 40 | On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates |
|---|
| 41 | an error. |
|---|
| 42 | .SH ERRORS |
|---|
| 43 | If the return code is negative, an error occurred. If the return code is not negative, an error may |
|---|
| 44 | or may not have occurred - the determination of what is an error and whether an error code is |
|---|
| 45 | returned is at the discretion of the ARM implementation. The application can test the return code |
|---|
| 46 | if it wants to provide its own error logging. |
|---|
| 47 | |
|---|
| 48 | The following errors are recognized by this implementation, but may not be portable to other implementations: |
|---|
| 49 | |
|---|
| 50 | .TP |
|---|
| 51 | .B ARM_FAILURE_NULL_ARGUMENT |
|---|
| 52 | The \fIlength\fR must not be null. |
|---|
| 53 | .SH "CONFORMING TO" |
|---|
| 54 | ARM Issue 4.0 C Language Bindings, Version 2 |
|---|
| 55 | .SH EXAMPLE |
|---|
| 56 | None. |
|---|
| 57 | .SH "SEE ALSO" |
|---|
| 58 | .BR arm_generate_correlator (3), |
|---|
| 59 | .BR arm_start_transaction (3) |
|---|