libdc/src/array.h
Jef Driesen 311bc85645 Add support for the Tusa IQ-700.
The Tusa IQ-700 is very similar to the other Seiko based models. The
most important change is that due the smaller amount of memory (8K vs
32K), the logbook entries are only 1 byte large instead of two bytes.
2015-04-22 08:25:03 +02:00

89 lines
2.4 KiB
C

/*
* libdivecomputer
*
* Copyright (C) 2008 Jef Driesen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
#ifndef ARRAY_H
#define ARRAY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void
array_reverse_bytes (unsigned char data[], unsigned int size);
void
array_reverse_bits (unsigned char data[], unsigned int size);
int
array_isequal (const unsigned char data[], unsigned int size, unsigned char value);
const unsigned char *
array_search_forward (const unsigned char *data, unsigned int size,
const unsigned char *marker, unsigned int msize);
const unsigned char *
array_search_backward (const unsigned char *data, unsigned int size,
const unsigned char *marker, unsigned int msize);
int
array_convert_bin2hex (const unsigned char input[], unsigned int isize, unsigned char output[], unsigned int osize);
int
array_convert_hex2bin (const unsigned char input[], unsigned int isize, unsigned char output[], unsigned int osize);
unsigned int
array_uint_be (const unsigned char data[], unsigned int n);
unsigned int
array_uint_le (const unsigned char data[], unsigned int n);
unsigned int
array_uint32_be (const unsigned char data[]);
unsigned int
array_uint32_le (const unsigned char data[]);
void
array_uint32_le_set (unsigned char data[], const unsigned int input);
unsigned int
array_uint24_be (const unsigned char data[]);
void
array_uint24_be_set (unsigned char data[], const unsigned int input);
unsigned int
array_uint24_le (const unsigned char data[]);
unsigned short
array_uint16_be (const unsigned char data[]);
unsigned short
array_uint16_le (const unsigned char data[]);
unsigned char
bcd2dec (unsigned char value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ARRAY_H */