9 * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 * IMPORTANT: All lengths (len) and offsets (start, end) are expressed in bits,
33 * All write primitives, as well as read for dynamically sized entities, can
34 * receive a NULL ptr/dest parameter. In this case, no write is performed, but
35 * the size is returned.
38 uint64_t ctf_uint_read(const unsigned char *ptr
, int byte_order
, size_t len
);
39 int64_t ctf_int_read(const unsigned char *ptr
, int byte_order
, size_t len
);
40 size_t ctf_uint_write(unsigned char *ptr
, int byte_order
, size_t len
, uint64_t v
);
41 size_t ctf_int_write(unsigned char *ptr
, int byte_order
, size_t len
, int64_t v
);
44 * ctf-types-bitfield.h declares:
46 * ctf_bitfield_unsigned_read
47 * ctf_bitfield_signed_read
48 * ctf_bitfield_unsigned_write
49 * ctf_bitfield_signed_write
51 #include <ctf/ctf-types-bitfield.h>
53 double ctf_double_read(const unsigned char *ptr
, const struct ctf_float
*src
)
54 size_t ctf_double_write(unsigned char *ptr
, const struct ctf_float
*dest
,
56 long double ctf_ldouble_read(const unsigned char *ptr
,
57 const struct ctf_float
*src
)
58 size_t ctf_ldouble_write(unsigned char *ptr
, const struct ctf_float
*dest
,
62 size_t mantissa_len
; /* Including sign bit */
65 void ctf_float_copy(unsigned char *destp
, const struct ctf_float
*dest
,
66 const unsigned char *srcp
, const struct ctf_float
*src
);
68 size_t ctf_string_copy(unsigned char *dest
, const unsigned char *src
);
71 * A GQuark can be translated to/from strings with g_quark_from_string() and
72 * g_quark_to_string().
74 GQuark
ctf_enum_uint_to_quark(const struct enum_table
*table
, uint64_t v
);
75 GQuark
ctf_enum_int_to_quark(const struct enum_table
*table
, uint64_t v
);
76 uint64_t ctf_enum_quark_to_uint(size_t len
, int byte_order
, GQuark q
);
77 int64_t ctf_enum_quark_to_int(size_t len
, int byte_order
, GQuark q
);
78 void ctf_enum_signed_insert(struct enum_table
*table
, int64_t v
, GQuark q
);
79 void ctf_enum_unsigned_insert(struct enum_table
*table
, uint64_t v
, GQuark q
);
80 struct enum_table
*ctf_enum_new(void);
81 void ctf_enum_destroy(struct enum_table
*table
);
83 #endif /* _CTF_TYPES_H */
This page took 0.033584 seconds and 5 git commands to generate.