AMU Library 3.0
C/C++ library for communicating with AMU (Aerospace Measurement Unit) devices
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/*-
2 * Copyright (c) 2012-2015 Jan Breuer,
3 *
4 * All Rights Reserved
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 * 1. Redistributions of source code must retain the above copyright notice,
10 * 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.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
22 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
35
36#ifndef SCPI_UTILS_H
37#define SCPI_UTILS_H
38
39#include <stdint.h>
40#include "types.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46 size_t SCPI_UInt32ToStrBase(uint32_t val, char * str, size_t len, int8_t base);
47 size_t SCPI_Int32ToStr(int32_t val, char * str, size_t len);
48 size_t SCPI_UInt64ToStrBase(uint64_t val, char * str, size_t len, int8_t base);
49 size_t SCPI_Int64ToStr(int64_t val, char * str, size_t len);
50 size_t SCPI_FloatToStr(float val, char * str, size_t len);
51 size_t SCPI_DoubleToStr(double val, char * str, size_t len);
52
53 /* deprecated finction, should be removed later */
54#define SCPI_LongToStr(val, str, len, base) SCPI_Int32ToStr((val), (str), (len), (base), TRUE)
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif /* SCPI_UTILS_H */
61
size_t SCPI_Int64ToStr(int64_t val, char *str, size_t len)
Definition utils.c:228
size_t SCPI_FloatToStr(float val, char *str, size_t len)
Definition utils.c:251
size_t SCPI_UInt32ToStrBase(uint32_t val, char *str, size_t len, int8_t base)
Definition utils.c:154
size_t SCPI_UInt64ToStrBase(uint64_t val, char *str, size_t len, int8_t base)
Definition utils.c:240
size_t SCPI_Int32ToStr(int32_t val, char *str, size_t len)
Definition utils.c:142
size_t SCPI_DoubleToStr(double val, char *str, size_t len)
Definition utils.c:263