7aeb74aa002956e03f82203fc07e4f4edb6557d3
2 * BabelTrace - Converter
6 * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <ctf/ctf-types.h>
28 * Type class hash table contains the registered type classes. Type class
29 * registration is typically performed by a plugin.
30 * TODO: support plugin unload (unregistration of type classes).
32 GHashTable
*type_classes
;
34 struct type_class
*ctf_lookup_type_class(GQuark qname
)
36 return g_hash_table_lookup(type_classes
,
37 (gconstpointer
) (unsigned long) qname
)
40 int ctf_register_type_class(const char *name
,
44 struct type_class tc
= g_new(struct type_class
, 1);
45 GQuark qname
= g_quark_from_string(name
);
47 if (ctf_lookup_type_class(qname
))
50 g_hash_table_insert(type_classes
,
51 (gconstpointer
) (unsigned long) qname
,
56 int ctf_init_types(void)
58 type_classes
= g_hash_table_new_full(g_direct_hash
, g_direct_equal
,
65 int ctf_finalize_types(void)
67 g_hash_table_destroy(type_classes
);
This page took 0.029897 seconds and 4 git commands to generate.