fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
uint8p.c
Go to the documentation of this file.
1#include "uint_t.h"
2
9void uint8_pack(char s[2],uint8 u)
10{
11 s[0] = u & 255;
12 s[1] = u >> 4;
13}
14
15void uint8_pack_big(char s[2],uint8 u)
16{
17 s[1] = u & 255;
18 s[0] = u >> 4;
19}
20
21void uint8_unpack(char s[2],uint8 *u)
22{
23 uint8 result;
24
25 result = (unsigned char) s[1]; result <<= 4;
26 result += (unsigned char) s[0];
27
28 *u = result;
29}
30
31void uint8_unpack_big(char s[2],uint8 *u)
32{
33 uint8 result;
34
35 result = (unsigned char) s[0]; result <<= 4;
36 result += (unsigned char) s[1];
37
38 *u = result;
39}
void uint8_unpack_big(char s[2], uint8 *u)
Definition: uint8p.c:31
void uint8_pack(char s[2], uint8 u)
Definition: uint8p.c:9
void uint8_pack_big(char s[2], uint8 u)
Definition: uint8p.c:15
void uint8_unpack(char s[2], uint8 *u)
Definition: uint8p.c:21
additional types and pack routines
unsigned char uint8
Definition: uint_t.h:17