tizen 2.3 release
[kernel/api/system-resource.git] / src / utils / hashtest.c
1 #include <glib.h>
2 #include <stdio.h>
3 static gboolean int_cmp(const void *ptr1, const void *ptr2)
4 {
5         return (GPOINTER_TO_INT(ptr1) == GPOINTER_TO_INT(ptr2)) ? TRUE : FALSE;
6 }
7
8 int main(void)
9 {
10         GHashTable *table = g_hash_table_new(g_direct_hash, int_cmp);
11         void *ptr = 0;
12         g_hash_table_insert(table, GINT_TO_POINTER(42), main);
13         ptr = g_hash_table_lookup(table, GINT_TO_POINTER(42));
14         printf("%p\n%p\n", ptr, main);
15         return 0;
16 }