]> git.lizzy.rs Git - endian.h.git/blob - README.md
Use include_next for system endian.h header
[endian.h.git] / README.md
1 # endian.h
2
3 This provides the endian conversion functions form endian.h on Windows, Linux,
4 *BSD, and Mac OS X. You still need to use `-std=gnu99` instead of `-std=c99`
5 for gcc. The functions might actually be macros. Functions: htobe16, htole16,
6 be16toh, le16toh, htobe32, htole32, be32toh, le32toh, htobe64, htole64,
7 be64toh, le64toh.
8
9 The implementation was written by Mathias Panzenböck and published in this
10 [Gist][gist].
11
12 ## Install
13
14 Install with [clib(1)]:
15
16 ```sh
17 clib install mikepb/endian.h
18 ```
19
20 ## Usage
21
22 ```c
23 #include <stdint.h>
24 #include "endian.h"
25
26 uint32_t endian32(const uint32_t i) {
27     return be32toh(i);
28 }
29 ```
30
31 ## License
32
33 Public Domain
34
35 [clib]: https://github.com/clibs/clib
36 [gist]: https://gist.github.com/panzi/6856583