First public contribution.
2 * LIBOIL - Library of Optimized Inner Loops
3 * Copyright (c) 2004 David A. Schleef <ds@schleef.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
27 //Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
35 #include <liboilfunction.h>
38 * SECTION:liboilfuncs-copy:
40 * @short_description: Functions for copying data
46 * @dest: destination array
48 * @n: number of elements
50 * Copies from source to destination.
52 OIL_DEFINE_CLASS (copy_u8, "uint8_t *dest, uint8_t *src, int n");
55 copy_u8_ref (uint8_t *dest, uint8_t *src, int n)
62 OIL_DEFINE_IMPL_REF (copy_u8_ref, copy_u8);
66 * @d_1: destination array
69 * @n: number of elements
71 * Compares two arrays. The index of the first two elements that are
72 * unequal is written into dest. If all elements are equal, @n is
75 OIL_DEFINE_CLASS (compare_u8, "uint32_t *d_1, uint8_t *s1, uint8_t *s2, int n");
78 compare_u8_ref (uint32_t *dest, uint8_t *src1, uint8_t *src2, int n)
83 if (src1[i] != src2[i]) {
90 OIL_DEFINE_IMPL_REF (compare_u8_ref, compare_u8);
94 * @d_1: destination array
96 * @n: number of elements
98 * Tests each element in the source array for equality with 0. The
99 * index of the first zero element is written into dest. If all
100 * elements are non-zero, @n is written into dest.
102 * This function is roughly equivalent to strnlen(). One notable
103 * difference is that implementations of this function may legally
104 * read past the zero byte.
106 OIL_DEFINE_CLASS (testzero_u8, "uint32_t *d_1, uint8_t *s, int n");
109 testzero_u8_ref (uint32_t *dest, uint8_t *src1, int n)
121 OIL_DEFINE_IMPL_REF (testzero_u8_ref, testzero_u8);
127 OilFunctionClass* __oil_function_class_copy_u8() {
128 return &_oil_function_class_copy_u8;
134 OilFunctionClass* __oil_function_class_compare_u8() {
135 return &_oil_function_class_compare_u8;
141 OilFunctionClass* __oil_function_class_testzero_u8() {
142 return &_oil_function_class_testzero_u8;
150 OilFunctionImpl* __oil_function_impl_copy_u8_ref() {
151 return &_oil_function_impl_copy_u8_ref;
157 OilFunctionImpl* __oil_function_impl_compare_u8_ref() {
158 return &_oil_function_impl_compare_u8_ref;
164 OilFunctionImpl* __oil_function_impl_testzero_u8_ref() {
165 return &_oil_function_impl_testzero_u8_ref;
173 EXPORT_C void** _oil_function_class_ptr_copy_u8 () {
174 oil_function_class_ptr_copy_u8 = __oil_function_class_copy_u8();
175 return &oil_function_class_ptr_copy_u8->func;
181 EXPORT_C void** _oil_function_class_ptr_compare_u8 () {
182 oil_function_class_ptr_compare_u8 = __oil_function_class_compare_u8();
183 return &oil_function_class_ptr_compare_u8->func;
189 EXPORT_C void** _oil_function_class_ptr_testzero_u8 () {
190 oil_function_class_ptr_testzero_u8 = __oil_function_class_testzero_u8();
191 return &oil_function_class_ptr_testzero_u8->func;