head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC5:1.1.1.1 netbsd-11-0-RC4:1.1.1.1 netbsd-11-0-RC3:1.1.1.1 netbsd-11-0-RC2:1.1.1.1 netbsd-11-0-RC1:1.1.1.1 perseant-exfatfs-base-20250801:1.1.1.1 netbsd-11:1.1.1.1.0.12 netbsd-11-base:1.1.1.1 netbsd-10-1-RELEASE:1.1.1.1 perseant-exfatfs-base-20240630:1.1.1.1 perseant-exfatfs:1.1.1.1.0.10 perseant-exfatfs-base:1.1.1.1 netbsd-10-0-RELEASE:1.1.1.1 netbsd-10-0-RC6:1.1.1.1 netbsd-10-0-RC5:1.1.1.1 netbsd-10-0-RC4:1.1.1.1 netbsd-10-0-RC3:1.1.1.1 netbsd-10-0-RC2:1.1.1.1 netbsd-10-0-RC1:1.1.1.1 netbsd-10:1.1.1.1.0.8 netbsd-10-base:1.1.1.1 cjep_sun2x-base1:1.1.1.1 cjep_sun2x:1.1.1.1.0.6 cjep_sun2x-base:1.1.1.1 cjep_staticlib_x-base1:1.1.1.1 cjep_staticlib_x:1.1.1.1.0.4 cjep_staticlib_x-base:1.1.1.1 phil-wifi-20200421:1.1.1.1 phil-wifi:1.1.1.1.0.2 phil-wifi-20200411:1.1.1.1 phil-wifi-20200406:1.1.1.1 libcbor-3b41770ab0ca408d242041dddb3b75811345573f:1.1.1.1 PJK:1.1.1; locks; strict; comment @# @; 1.1 date 2020.03.03.00.34.30; author christos; state Exp; branches 1.1.1.1; next ; commitid CsDukytrNgtSbTYB; 1.1.1.1 date 2020.03.03.00.34.30; author christos; state Exp; branches 1.1.1.1.2.1; next ; commitid CsDukytrNgtSbTYB; 1.1.1.1.2.1 date 2020.03.03.00.34.30; author martin; state dead; branches; next 1.1.1.1.2.2; commitid X01YhRUPVUDaec4C; 1.1.1.1.2.2 date 2020.04.13.08.02.26; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; desc @@ 1.1 log @Initial revision @ text @ libcbor: src/cbor/floats_ctrls.h Source File
libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
floats_ctrls.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017 Pavel Kalvoda <me@@pavelkalvoda.com>
3  *
4  * libcbor is free software; you can redistribute it and/or modify
5  * it under the terms of the MIT license. See LICENSE for details.
6  */
7 
8 #ifndef LIBCBOR_FLOATS_CTRLS_H
9 #define LIBCBOR_FLOATS_CTRLS_H
10 
11 #include "cbor/common.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /*
18 * ============================================================================
19 * Float manipulation
20 * ============================================================================
21 */
22 
28 bool cbor_float_ctrl_is_ctrl(const cbor_item_t * item);
29 
36 
44 float cbor_float_get_float2(const cbor_item_t * item);
45 
53 float cbor_float_get_float4(const cbor_item_t * item);
54 
62 double cbor_float_get_float8(const cbor_item_t * item);
63 
71 double cbor_float_get_float(const cbor_item_t * item);
72 
80 
88 
96 
104 
110 
116 
122 cbor_item_t * cbor_build_bool(bool value);
123 
133 void cbor_set_ctrl(cbor_item_t * item, uint8_t value);
134 
140 void cbor_set_float2(cbor_item_t * item, float value);
141 
147 void cbor_set_float4(cbor_item_t * item, float value);
148 
154 void cbor_set_float8(cbor_item_t * item, double value);
155 
161 uint8_t cbor_ctrl_value(const cbor_item_t * item);
162 
168 bool cbor_ctrl_is_bool(const cbor_item_t * item);
169 
175 cbor_item_t *cbor_build_float2(float value);
176 
182 cbor_item_t *cbor_build_float4(float value);
183 
189 cbor_item_t *cbor_build_float8(double value);
190 
196 cbor_item_t *cbor_build_ctrl(uint8_t value);
197 
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif //LIBCBOR_FLOATS_CTRLS_H
uint8_t cbor_ctrl_value(const cbor_item_t *item)
Reads the control value.
Definition: floats_ctrls.c:18
void cbor_set_ctrl(cbor_item_t *item, uint8_t value)
Assign a control value.
Definition: floats_ctrls.c:85
bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item)
Is this a ctrl value?
Definition: floats_ctrls.c:25
cbor_float_width
Possible widths of CBOR_TYPE_FLOAT_CTRL items.
Definition: data.h:54
void cbor_set_float8(cbor_item_t *item, double value)
Assigns a float value.
Definition: floats_ctrls.c:78
cbor_item_t * cbor_build_float8(double value)
Constructs a new float.
Definition: floats_ctrls.c:179
cbor_item_t * cbor_new_ctrl()
Constructs a new ctrl item.
Definition: floats_ctrls.c:98
bool cbor_ctrl_is_bool(const cbor_item_t *item)
Is this ctrl item a boolean?
Definition: floats_ctrls.c:92
cbor_item_t * cbor_build_float4(float value)
Constructs a new float.
Definition: floats_ctrls.c:172
cbor_float_width cbor_float_get_width(const cbor_item_t *item)
Get the float width.
Definition: floats_ctrls.c:12
cbor_item_t * cbor_new_null()
Constructs new null ctrl item.
Definition: floats_ctrls.c:146
cbor_item_t * cbor_new_float8()
Constructs a new float item.
Definition: floats_ctrls.c:134
void cbor_set_float2(cbor_item_t *item, float value)
Assigns a float value.
Definition: floats_ctrls.c:64
double cbor_float_get_float8(const cbor_item_t *item)
Get a double precision float.
Definition: floats_ctrls.c:45
cbor_item_t * cbor_build_bool(bool value)
Constructs new boolean ctrl item.
Definition: floats_ctrls.c:160
void cbor_set_float4(cbor_item_t *item, float value)
Assigns a float value.
Definition: floats_ctrls.c:71
cbor_item_t * cbor_build_ctrl(uint8_t value)
Constructs a ctrl item.
Definition: floats_ctrls.c:186
cbor_item_t * cbor_build_float2(float value)
Constructs a new float.
Definition: floats_ctrls.c:165
float cbor_float_get_float4(const cbor_item_t *item)
Get a single precision float.
Definition: floats_ctrls.c:38
double cbor_float_get_float(const cbor_item_t *item)
Get the float value represented as double.
Definition: floats_ctrls.c:52
cbor_item_t * cbor_new_undef()
Constructs new under ctrl item.
Definition: floats_ctrls.c:153
The item handle.
Definition: data.h:149
float cbor_float_get_float2(const cbor_item_t *item)
Get a half precision float.
Definition: floats_ctrls.c:31
cbor_item_t * cbor_new_float2()
Constructs a new float item.
Definition: floats_ctrls.c:110
cbor_item_t * cbor_new_float4()
Constructs a new float item.
Definition: floats_ctrls.c:122
@ 1.1.1.1 log @Import libcbor from: https://github.com/PJK/libcbor.git @ text @@ 1.1.1.1.2.1 log @file floats__ctrls_8h_source.html was added on branch phil-wifi on 2020-04-13 08:02:26 +0000 @ text @d1 106 @ 1.1.1.1.2.2 log @Mostly merge changes from HEAD upto 20200411 @ text @a0 106 libcbor: src/cbor/floats_ctrls.h Source File
libcbor  0.5.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
floats_ctrls.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017 Pavel Kalvoda <me@@pavelkalvoda.com>
3  *
4  * libcbor is free software; you can redistribute it and/or modify
5  * it under the terms of the MIT license. See LICENSE for details.
6  */
7 
8 #ifndef LIBCBOR_FLOATS_CTRLS_H
9 #define LIBCBOR_FLOATS_CTRLS_H
10 
11 #include "cbor/common.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /*
18 * ============================================================================
19 * Float manipulation
20 * ============================================================================
21 */
22 
28 bool cbor_float_ctrl_is_ctrl(const cbor_item_t * item);
29 
36 
44 float cbor_float_get_float2(const cbor_item_t * item);
45 
53 float cbor_float_get_float4(const cbor_item_t * item);
54 
62 double cbor_float_get_float8(const cbor_item_t * item);
63 
71 double cbor_float_get_float(const cbor_item_t * item);
72 
80 
88 
96 
104 
110 
116 
122 cbor_item_t * cbor_build_bool(bool value);
123 
133 void cbor_set_ctrl(cbor_item_t * item, uint8_t value);
134 
140 void cbor_set_float2(cbor_item_t * item, float value);
141 
147 void cbor_set_float4(cbor_item_t * item, float value);
148 
154 void cbor_set_float8(cbor_item_t * item, double value);
155 
161 uint8_t cbor_ctrl_value(const cbor_item_t * item);
162 
168 bool cbor_ctrl_is_bool(const cbor_item_t * item);
169 
175 cbor_item_t *cbor_build_float2(float value);
176 
182 cbor_item_t *cbor_build_float4(float value);
183 
189 cbor_item_t *cbor_build_float8(double value);
190 
196 cbor_item_t *cbor_build_ctrl(uint8_t value);
197 
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif //LIBCBOR_FLOATS_CTRLS_H
uint8_t cbor_ctrl_value(const cbor_item_t *item)
Reads the control value.
Definition: floats_ctrls.c:18
void cbor_set_ctrl(cbor_item_t *item, uint8_t value)
Assign a control value.
Definition: floats_ctrls.c:85
bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item)
Is this a ctrl value?
Definition: floats_ctrls.c:25
cbor_float_width
Possible widths of CBOR_TYPE_FLOAT_CTRL items.
Definition: data.h:54
void cbor_set_float8(cbor_item_t *item, double value)
Assigns a float value.
Definition: floats_ctrls.c:78
cbor_item_t * cbor_build_float8(double value)
Constructs a new float.
Definition: floats_ctrls.c:179
cbor_item_t * cbor_new_ctrl()
Constructs a new ctrl item.
Definition: floats_ctrls.c:98
bool cbor_ctrl_is_bool(const cbor_item_t *item)
Is this ctrl item a boolean?
Definition: floats_ctrls.c:92
cbor_item_t * cbor_build_float4(float value)
Constructs a new float.
Definition: floats_ctrls.c:172
cbor_float_width cbor_float_get_width(const cbor_item_t *item)
Get the float width.
Definition: floats_ctrls.c:12
cbor_item_t * cbor_new_null()
Constructs new null ctrl item.
Definition: floats_ctrls.c:146
cbor_item_t * cbor_new_float8()
Constructs a new float item.
Definition: floats_ctrls.c:134
void cbor_set_float2(cbor_item_t *item, float value)
Assigns a float value.
Definition: floats_ctrls.c:64
double cbor_float_get_float8(const cbor_item_t *item)
Get a double precision float.
Definition: floats_ctrls.c:45
cbor_item_t * cbor_build_bool(bool value)
Constructs new boolean ctrl item.
Definition: floats_ctrls.c:160
void cbor_set_float4(cbor_item_t *item, float value)
Assigns a float value.
Definition: floats_ctrls.c:71
cbor_item_t * cbor_build_ctrl(uint8_t value)
Constructs a ctrl item.
Definition: floats_ctrls.c:186
cbor_item_t * cbor_build_float2(float value)
Constructs a new float.
Definition: floats_ctrls.c:165
float cbor_float_get_float4(const cbor_item_t *item)
Get a single precision float.
Definition: floats_ctrls.c:38
double cbor_float_get_float(const cbor_item_t *item)
Get the float value represented as double.
Definition: floats_ctrls.c:52
cbor_item_t * cbor_new_undef()
Constructs new under ctrl item.
Definition: floats_ctrls.c:153
The item handle.
Definition: data.h:149
float cbor_float_get_float2(const cbor_item_t *item)
Get a half precision float.
Definition: floats_ctrls.c:31
cbor_item_t * cbor_new_float2()
Constructs a new float item.
Definition: floats_ctrls.c:110
cbor_item_t * cbor_new_float4()
Constructs a new float item.
Definition: floats_ctrls.c:122
@