Debian Codegraph @

libdrgn/python/test.c

raw
1 // Copyright (c) Meta Platforms, Inc. and affiliates.
2 // SPDX-License-Identifier: LGPL-2.1-or-later
3
4 /*
5 * Wrapper functions for testing.
6 *
7 * In order to test a few internal interfaces that don't have Python bindings,
8 * we export some wrappers for those interfaces. These wrappers are accessed via
9 * ctypes.
10 *
11 * The extra declarations are needed to silence -Wmissing-prototypes.
12 */
13
14 #include "drgnpy.h"
15 #include "../serialize.h"
16
17 typeof(serialize_bits) drgn_test_serialize_bits;
18 DRGNPY_PUBLIC void drgn_test_serialize_bits(void *buf, uint64_t bit_offset,
19 uint64_t uvalue, uint8_t bit_size,
20 bool little_endian)
21 {
22 return serialize_bits(buf, bit_offset, uvalue, bit_size, little_endian);
23 }
24
25 typeof(deserialize_bits) drgn_test_deserialize_bits;
26 DRGNPY_PUBLIC uint64_t drgn_test_deserialize_bits(const void *buf,
27 uint64_t bit_offset,
28 uint8_t bit_size,
29 bool little_endian)
30 {
31 return deserialize_bits(buf, bit_offset, bit_size, little_endian);
32 }