fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
uint32p.c
Go to the documentation of this file.
1#include "uint_t.h"
2
10void uint32_pack(char s[4],uint32 u)
11{
12 s[0] = u & 255; u >>= 8;
13 s[1] = u & 255; u >>= 8;
14 s[2] = u & 255;
15 s[3] = u >> 8;
16}
17void uint32_pack_big(char s[4],uint32 u)
18{
19 s[3] = u & 255; u >>= 8;
20 s[2] = u & 255; u >>= 8;
21 s[1] = u & 255;
22 s[0] = u >> 8;
23}
24
25void uint32_unpack(char s[4],uint32 *u)
26{
27 uint32 result;
28
29 result = (unsigned char) s[3]; result <<= 8;
30 result += (unsigned char) s[2]; result <<= 8;
31 result += (unsigned char) s[1]; result <<= 8;
32 result += (unsigned char) s[0];
33
34 *u = result;
35}
36
37void uint32_unpack_big(char s[4],uint32 *u)
38{
39 uint32 result;
40
41 result = (unsigned char) s[0]; result <<= 8;
42 result += (unsigned char) s[1]; result <<= 8;
43 result += (unsigned char) s[2]; result <<= 8;
44 result += (unsigned char) s[3];
45
46 *u = result;
47}
void uint32_unpack(char s[4], uint32 *u)
Definition: uint32p.c:25
void uint32_unpack_big(char s[4], uint32 *u)
Definition: uint32p.c:37
void uint32_pack_big(char s[4], uint32 u)
Definition: uint32p.c:17
void uint32_pack(char s[4], uint32 u)
Definition: uint32p.c:10
additional types and pack routines
uint32_t uint32
Definition: uint_t.h:40