Blame


1 5d2f4b16 2023-07-02 op /*
2 5d2f4b16 2023-07-02 op * Copyright (c) 2023 Omar Polo <op@omarpolo.com>
3 5d2f4b16 2023-07-02 op *
4 5d2f4b16 2023-07-02 op * Permission to use, copy, modify, and distribute this software for any
5 5d2f4b16 2023-07-02 op * purpose with or without fee is hereby granted, provided that the above
6 5d2f4b16 2023-07-02 op * copyright notice and this permission notice appear in all copies.
7 5d2f4b16 2023-07-02 op *
8 5d2f4b16 2023-07-02 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 5d2f4b16 2023-07-02 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 5d2f4b16 2023-07-02 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 5d2f4b16 2023-07-02 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 5d2f4b16 2023-07-02 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 5d2f4b16 2023-07-02 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 5d2f4b16 2023-07-02 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 5d2f4b16 2023-07-02 op */
16 5d2f4b16 2023-07-02 op
17 5d2f4b16 2023-07-02 op #include <sys/endian.h>
18 5d2f4b16 2023-07-02 op #include <stdint.h>
19 5d2f4b16 2023-07-02 op
20 5d2f4b16 2023-07-02 op int
21 5d2f4b16 2023-07-02 op main(void)
22 5d2f4b16 2023-07-02 op {
23 5d2f4b16 2023-07-02 op uint16_t x;
24 5d2f4b16 2023-07-02 op
25 5d2f4b16 2023-07-02 op x = 42;
26 5d2f4b16 2023-07-02 op return (htobe16(x));
27 5d2f4b16 2023-07-02 op }