aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
blob: d8a962269d245f0127e3f90c6d904b4075d85105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * Copyright (C) 2020-2021 Tomasz Kramkowski <tk@the-tk.com>
 * SPDX-License-Identifier: MIT
 */
#ifndef PACK_COMMON_H
#define PACK_COMMON_H

#include <limits.h>
#include <stddef.h>

#define BITMASK(n) (UINTMAX_MAX >> (sizeof (uintmax_t) * CHAR_BIT - n))

enum endian { BIG, LITTLE };

size_t getsize(char c);

#endif // !PACK_COMMON_H