4657a28fa7d4bbf035d26d4458e92d29503c535c
1 #ifndef _CTF_TYPES_BITFIELD_H
2 #define _CTF_TYPES_BITFIELD_H
7 * Bitfields read/write functions.
9 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * Dual LGPL v2.1/GPL v2 license.
14 #include <ctf/bitfield.h>
18 * ctf_bitfield_unsigned_read and ctf_bitfield_signed_read are defined by
21 * The write primitives below are provided as wrappers over
22 * ctf_bitfield_write_le and ctf_bitfield_write_be to specify per-byte write of
23 * signed/unsigned integers through a standard API.
27 size_t ctf_bitfield_unsigned_write(uint8_t *ptr
,
28 unsigned long start
, unsigned long len
,
29 int byte_order
, uint64_t v
)
33 if (byte_order
== LITTLE_ENDIAN
)
34 ctf_bitfield_write_le(ptr
, start
, len
, v
);
36 ctf_bitfield_write_be(ptr
, start
, len
, v
);
42 size_t ctf_bitfield_signed_write(uint8_t *ptr
,
43 unsigned long start
, unsigned long len
,
44 int byte_order
, int64_t v
)
48 if (byte_order
== LITTLE_ENDIAN
)
49 ctf_bitfield_write_le(ptr
, start
, len
, v
);
51 ctf_bitfield_write_be(ptr
, start
, len
, v
);
56 #endif /* _CTF_TYPES_BITFIELD_H */
This page took 0.030776 seconds and 4 git commands to generate.