Monado OpenXR Runtime
u_bitwise.h
Go to the documentation of this file.
1// Copyright 2019-2020, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Functions for manipulating tightly packed data as bits.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @author Pete Black <pete.black@collabora.com>
8 * @ingroup aux_util
9 */
10
11#pragma once
12
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19int
20get_bit(const unsigned char *b, int num);
21
22int
23get_bits(const unsigned char *b, int start, int num);
24
25/*!
26 * Interpret the least-significant 13 bits as a signed 13-bit integer, and cast
27 * it to a signed int for normal usage.
28 */
29int
30sign_extend_13(uint32_t i);
31
32
33#ifdef __cplusplus
34}
35#endif
int sign_extend_13(uint32_t i)
Interpret the least-significant 13 bits as a signed 13-bit integer, and cast it to a signed int for n...
Definition: u_bitwise.c:34