EtcPal  HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
View other versions:
pack64.h
1 /******************************************************************************
2  * Copyright 2022 ETC Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *******************************************************************************
16  * This file is a part of EtcPal. For more information, go to:
17  * https://github.com/ETCLabs/EtcPal
18  ******************************************************************************/
19 
20 /* etcpal/pack64.h: Optional extensions to etcpal_pack for 64-bit types. */
21 
22 #ifndef ETCPAL_PACK64_H_
23 #define ETCPAL_PACK64_H_
24 
25 #include <stdint.h>
26 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 int64_t etcpal_unpack_i64b(const uint8_t* buf);
37 void etcpal_pack_i64b(uint8_t* buf, int64_t val);
38 int64_t etcpal_unpack_i64l(const uint8_t* buf);
39 void etcpal_pack_i64l(uint8_t* buf, int64_t val);
40 
41 uint64_t etcpal_unpack_u64b(const uint8_t* buf);
42 void etcpal_pack_u64b(uint8_t* buf, uint64_t val);
43 uint64_t etcpal_unpack_u64l(const uint8_t* buf);
44 void etcpal_pack_u64l(uint8_t* buf, uint64_t val);
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
54 #endif /* ETCPAL_PACK64_H_ */
void etcpal_pack_i64l(uint8_t *buf, int64_t val)
Pack an int64_t to a known little-endian buffer.
Definition: pack.c:274
void etcpal_pack_u64b(uint8_t *buf, uint64_t val)
Pack a uint64_t to a known big-endian buffer.
Definition: pack.c:306
int64_t etcpal_unpack_i64b(const uint8_t *buf)
Unpack an int64_t from a known big-endian buffer.
Definition: pack.c:244
uint64_t etcpal_unpack_u64b(const uint8_t *buf)
Unpack a uint64_t from a known big-endian buffer.
Definition: pack.c:284
void etcpal_pack_u64l(uint8_t *buf, uint64_t val)
Pack a uint64_t to a known little-endian buffer.
Definition: pack.c:348
void etcpal_pack_i64b(uint8_t *buf, int64_t val)
Pack an int64_t to a known big-endian buffer.
Definition: pack.c:254
int64_t etcpal_unpack_i64l(const uint8_t *buf)
Unpack an int64_t from a known little-endian buffer.
Definition: pack.c:264
uint64_t etcpal_unpack_u64l(const uint8_t *buf)
Unpack a uint64_t from a known little-endian buffer.
Definition: pack.c:326