-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbytesex.h
More file actions
38 lines (28 loc) · 772 Bytes
/
bytesex.h
File metadata and controls
38 lines (28 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* bytesex.h -- reversing bytesex */
#ifndef UTILS_BYTESEX_H
#define UTILS_BYTESEX_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stddef.h>
/* Reverse bytesex.
*
* 's'hort or 'l'ong
*
* _m -> from memory (takes a pointer, reads as chars)
* _pair -> two packed arguments
* _block -> array of things to swap
*/
unsigned short int rev_s(unsigned short int);
unsigned short int rev_s_m(const unsigned char *);
unsigned int rev_s_pair(unsigned int);
unsigned int rev_s_pair_m(const unsigned char *);
unsigned int rev_l(unsigned int);
unsigned int rev_l_m(const unsigned char *);
void rev_s_block(unsigned short int *array, size_t nelems);
void rev_l_block(unsigned int *array, size_t nelems);
#ifdef __cplusplus
}
#endif
#endif /* UTILS_BYTESEX_H */